Search Results

Search found 1517 results on 61 pages for 'aspect ratio'.

Page 2/61 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Why is Spritebatch drawing my Textures out of order?

    - by Andrew
    I just started working with XNA Studio after programming 2D games in java. Because of this, I have absolutely no experience with Spritebatch and sprite sorting. In java, I could just layer the images by calling the draw methods in order. For a while, my Spritebatch was working fine in deferred sorting mode, but when I made a change to one of my textures, it suddenly started drawing them out of order. I have searched for a solution to this problem, but nothing seems to work. I have tried adding layer depths to the sprites and changing the sort mode to BackToFront or FrontToBack or even immediate, but nothing seems to work. Here is my drawing code: protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.Gray); Game1.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null); for (int x = 0; x < 5; x++) { for (int y = 0; y < 5; y++) { region[x, y].draw(((float)w / aw)); // Draws the Tile-Based background } } player.draw(spriteBatch, ((float)w / aw));//draws the character (This method is where the problem occurs) enemy.draw(spriteBatch, (float)w/aw); // draws a basic enemy Game1.spriteBatch.End(); base.Draw(gameTime); } player.draw method: public void draw(SpriteBatch sb, float ratio){ //draws the player base (The character without hair or equipment) sb.Draw(playerbase[0], new Rectangle((int)(pos.X - (24 * ratio)), (int)(pos.Y - (48 * ratio)), (int)(48 * ratio), (int)(48 * ratio)), new Rectangle(orientation * 48, animFrame * 48, 48, 48), Color.White,0,Vector2.Zero,SpriteEffects.None,0); //draws the player's hair sb.Draw(playerbase[3], new Rectangle((int)(pos.X - (24 * ratio)), (int)(pos.Y - (48 * ratio)), (int)(48 * ratio), (int)(48 * ratio)), new Rectangle(orientation * 48, animFrame * 48, 48, 48), Color.White, 0, Vector2.Zero, SpriteEffects.None, 0); //draws the player's shirt sb.Draw(equipment[0], new Rectangle((int)(pos.X - (24 * ratio)), (int)(pos.Y - (48 * ratio)), (int)(48 * ratio), (int)(48 * ratio)), new Rectangle(orientation * 48, animFrame * 48, 48, 48), Color.White, 0, Vector2.Zero, SpriteEffects.None, 0); //draws the player's pants sb.Draw(equipment[1], new Rectangle((int)(pos.X - (24 * ratio)), (int)(pos.Y - (48 * ratio)), (int)(48 * ratio), (int)(48 * ratio)), new Rectangle(orientation * 48, animFrame * 48, 48, 48), Color.White, 0, Vector2.Zero, SpriteEffects.None, 0); //draws the player's shoes sb.Draw(equipment[2], new Rectangle((int)(pos.X - (24 * ratio)), (int)(pos.Y - (48 * ratio)), (int)(48 * ratio), (int)(48 * ratio)), new Rectangle(orientation * 48, animFrame * 48, 48, 48), Color.White, 0, Vector2.Zero, SpriteEffects.None, 0); } the game has a top-down perspective much like the early legend of zelda games. It draws sections of the texture depending on which direction the character is facing and the animation frame. However, instead of drawing the character in the order the draw methods are called, it ends up drawing the character out of order. Please help me with this problem.

    Read the article

  • getting aspect related information reg

    - by GowthamanSS
    Suppose i have these structure as class ss { public void createfile() { StreamWriter sw= new StreamWriter("d:/test.txt"); } } i need to do aspect where ever i use StreamWriter? as for as consideration i already used the below code as [assembly: MyAspect(AttributeTargetAssembly="mscorlib", AttributeTargetTypes="System.IO.File", AttributeTargetMembers="Create"] for file.create method .. it works fine .. Is there any way to solve this problem ... waiting for your response

    Read the article

  • Unittesting aspect-oriented features.

    - by Tomas Brambora
    Hi, I'd like to know what would you propose as the best way to unit test aspect-oriented application features (well, perhaps that's not the best name, but it's the best I was able to come up with :-) ) such as logging or security? These things are sort of omni-present in the application, so how to test them properly? E.g. say that I'm writing a Cherrypy web server in Python. I can use a decorator to check whether the logged-in user has the permission to access a given page. But then I'd need to write a test for every page to see whether it works oK (or more like to see that I had not forgotten to check security perms for that page). This could maybe (emphasis on maybe) be bearable if logging and/or security were implemented during the web server "normal business implementation". However, security and logging usually tend to be added to the app as an afterthough (or maybe that's just my experience, I'm usually given a server and then asked to implement security model :-) ). Any thoughts on this are very welcome. I have currently 'solved' this issue by, well - not testing this at all. Thanks.

    Read the article

  • Aspect Oriented Programming Library/Framework for Actionscript 3?

    - by Tom
    I'm looking for a full featured AOP Library for Actionscript 3. The following projects I noticed so far, but they all seem to have their problems: - http://farmcode.org/page/Sodality.aspx (looks most promising so far, however it requires you to create a whole new class for every AOP "call" I believe, and it forces you to follow quite a lot of restrictions, anyone has experience with it? - http://code.google.com/p/loom-as3/ (this one is discontinued) - http://code.google.com/p/floxy/ (dynamic proxy generation? this isn't really AOP as I know it, right?) - http://code.google.com/p/flemit/ (dynamic byte code generation? this is something AOP needs I think, but not the full featured AOP framework I am looking for) Does anyone know of a better solution? Or does anyone have any experiences with AOP in Actionscript 3? Best regards, Tom

    Read the article

  • Screen Aspect Ratio

    - by Bill Evjen
    Jeffrey Dean, Pixar Aspect Ratio is very important to home video. What is aspect ratio – the ratio from the height to the width 2.35:1 The image is 2.35 times wide as it is high Pixar uses this for half of our movies This is called a widescreen image When modified to fit your television screen They cut this to fit the box of your screen When a comparison is made huge chunks of picture is missing It is harder to find what is going on when these pieces are missing The whole is greater than the pieces themselves. If you are missing pieces – you are missing the movie The soul and the mood is in the film shots. Cutting it to fit a screen, you are losing 30% of the movie Why different aspect ratios? Film before the 1950s 1.33:1 Academy Standard There were all aspects of images though. There was no standard. Thomas Edison developed projecting images onto a wall/screen He didn’t patent it as he saw no value in it. Then 1.37:1 came about to add a strip of sound This is the same size as a 35mm film Around 1952 – TV comes along NTSC Television followed the Academy Standard (4x3) Once TV came out, movie theater attendance plummets So Film brought forth color to combat this. Also early 3D Also Widescreen was brought forth. Cinema-Scope Studios at the time made movies bigger and bigger There was a Napoleon movie that was actually 4x1 … really wide. 1.85:1 Academy Flat 2.35:1 Anamorphic Scope (aka Panavision/Cinemascope) Almost all movies are made in these two aspect ratios Pixar has done half in one and half in the other Why choose one over the other? Artist choice It is part of the story the director wants to tell Can we preserve the story outside of the theaters? TVs before 1998 – they were very square Now TVs are very wide Historical options Toy Story released as it was and people cut it in a way that wasn’t liked by the studio Pan and Scan is another option Cut and then scan left or right depending on where the action is Frame Height Pixar can go back and animate more picture to account for the bottom/top bars. You end up with more sky and more ground The characters seem to get lost in the picture You lose what the director original intended Re-staging For animated movies, you can move characters around – restage the scene. It is a new completely different version of the film This is the best possible option that Pixar came up with They have stopped doing this really as the demand as pretty much dropped off Why not 1.33 today? There has been an evolution of taste and demands. VHS is a linear item The focus is about portability and not about quality Most was pan and scan and the quality was so bad – but people didn’t notice DVD was introduced in 1996 You could have more content – two versions of the film You could have the widescreen version and the 1.33 version People realized that they are seeing more of the movie with the widescreen High Def Televisions (16x9 monitors) This was introduced in 2005 Blu-ray Disc was introduced in 2006 This is all widescreen You cannot find a square TV anymore TVs are roughly 1.85:1 aspect ratio There is a change in demand Users are used to black bars and are used to widescreen Users are educated now What’s next for in-flight entertainment? High Def IFE Personal Electronic Devices 3D inflight

    Read the article

  • Is there a "golden ratio" in coding?

    - by badallen
    My coworkers and I often come up with silly ideas such as adding entries to Urban Dictionary that are inappropriate but completely make sense if you are a developer. Or making rap songs that are about delegates, reflections or closures in JS... Anyhow, here is what I brought up this afternoon which was immediately dismissed to be a stupid idea. So I want to see if I can get redemptions here. My idea is coming up with a Golden Ratio (or in the neighborhood of) between the number of classes per project versus the number of methods/functions per class versus the number of lines per method/function. I know this is silly and borderline, if not completely, useless, but just think of all the legacy methods or classes you have encountered that are absolutely horrid - like methods with 10000 lines or classes with 10000 methods. So Golden Ratio, anyone? :)

    Read the article

  • Demantra Performance Clustering Factor Out of Order Ratio TABLE_REORG CHECK_REORG (Doc ID 1594372.1)

    - by user702295
    Hello!   There is a new document available: Demantra Performance Clustering Factor Out of Order Ratio TABLE_REORG CHECK_REORG (Doc ID 1594372.1) Demantra Performance Clustering Factor Out of Order Ratio TABLE_REORG CHECK_REORG The table reorganization can be setup to automatically run in version 7.3.1.5.  In version 12.2.2 we run the TABLE_REORG.CHECK_REORG function at every appserver restart. If the function recommends a reorg then we strongly encourage to reorg the database object.  This is documented in the official docs. In versions 7.3.1.3 and 7.3.1.4, the TABLE_REORG module exists and can be used. It has two main functions that are documented in the Implementation Guide Supplement, Release 7.3, Part No. E26760-03, chapter 4. In short, if you are using version 7.3.1.3 or higher, you can check for the need to run a reorg by doing the following 2 steps: 1. Run TABLE_REORG.CHECK_REORG('T'); 2. Check the table LOG_TABLE_REORG for recommendations If you are on a version before 7.3.1.3, you will need to follow the instructions below to determine if you need to do a manual reorg. How to determine if a table reorg is needed 1. It is strongly encouraged by DEV that You gather statistics on the required table.  The prefered percentage for the gather is 100%. 2. Run the following SQL to evaluate how table reorg might affect Primary Key (PK) based access:   SELECT ui.index_name,trunc((ut.num_rows/ui.clustering_factor)/(ut.num_rows/ut.blocks),2) FROM user_indexes ui, user_tables ut, user_constraints uc WHERE ui.table_name=ut.table_name AND ut.table_name=uc.table_name AND ui.index_name=uc.index_name AND UC.CONSTRAINT_TYPE='P' AND ut.table_name=upper('&enter_table_name');   3. Based on the result: VALUE ABOVE 0.75 - DOES NOT REQUIRE REORG VALUE BETWEEN 0.5 AND 0.75 - REORG IS RECOMMENDED VALUE LOWER THAN 0.5 - IT IS HIGHLY RECOMMENDED TO REORG

    Read the article

  • Standard ratio of cookies to "visitors"?

    - by Jeff Atwood
    As noted in a recent blog post, We see a large discrepancy between Google Analytics "visitors" and Quantcast "visitors". Also, for reasons we have never figured out, Google Analytics just gets larger numbers than Quantcast. Right now GA is showing more visitors (15 million) on stackoverflow.com alone than Quantcast sees on the whole network (14 million): Why? I don’t know. Either Google Analytics loses cookies sometimes, or Quantcast misses visitors. Counting is an inexact science. We think this is because Quantcast uses a more conservative ratio of cookies-to-visitors. Whereas Google Analytics might consider every cookie a "visitor", Quantcast will only consider every 1.24 cookies a "visitor". This makes sense to me, as people may access our sites from multiple computers, multiple browsers, etcetera. I have two closely related questions: Is there an accepted standard ratio of cookies to visitors? This is obviously an inexact science, but is there any emerging rule of thumb? Is there any more accurate way to count "visitors" to a website other than relying on browser cookies? Or is this just always going to be kind of a best-effort estimation crapshoot no matter how you measure it?

    Read the article

  • average screen ratio

    - by sam
    Im building a portfolio website that uses full screen background images slideshow that are cropped to fit using a js plugin. To give the minimum amount of cropping whats the best ratio to make the images ? ie i know 13" macbooks are around 13:7 (when taking into account about 100px for the browser bar) but does that scale up on 15",24",17" displays ? I know there are charts showing the most common dimensions but they just show a range of sizes and thats categorized by groups rather than actual dimensions

    Read the article

  • ExtJS 5.0 : amélioration de l'aspect tactile et architecture MVVM, Sencha consolide son framework JavaScript

    Sortie de ExtJS 5.0 : amélioration de l'aspect tactile et architecture MVVML'équipe Sencha annonce la sortie de ExtJS 5.0 !Parmi les nouveautés et les améliorations, nous pouvons découvrir :le support des plateformes tactiles ;une architecture MVVM et la liaison des données à deux sens ;la possibilité d'ajouter des composants dans les cellules d'une grille pour la visualisation des données ;un système de mise en page responsive ; Code javasctipt : Sélectionner tout...

    Read the article

  • What are the advantages and Disadvantages of Using an Aspect Orientated Programming Paradigm

    - by JHarley1
    Ok so here is the question: What are the advantages and Disadvantages of Using an Aspect Orientated Programming Paradigm. My advantages and disadvantages thus far: Advantages: Complements object orientation. Modularizes cross-cutting concerns improving code maintainability and understandability. Disadvantage: Not the easiest of concepts to grasp - not as well documented as O-O O-O goes far enough in the separation of concerns... List item Would anyone like to challenge any of these/ add their own? Many Thanks, J

    Read the article

  • High Lock Wait ratio in MySQL

    - by FunkyChicken
    on my site I log every pageview (date,ip,referrer,page,etc) in a simple mysql table. This table gets very little selects (3 per minute), but a lot of inserts. (about 100 per second) Today I changed this table from an InnoDB table to a MEMORY table, this made sense to me to prevent unnecessary hard disk IO. I also prune this table once per minute, to make sure it never get's too big. -- Performance wise, things are running fine. But I noticed that while running tuning-primer, that my Current Lock Wait ratio is quite high. Current Lock Wait ratio = 1 : 561 My question: Should I worry about this Lock Wait Ratio? And is there something I can change in my my.cnf to improve things so that the lock wait ratio isn't so high?

    Read the article

  • How to access private static target field in aspect in AspectJ?

    - by LihO
    I have a simple class Main with private static int x and an aspect that should output the old value of x before it is reassigned: public class Main { private static int x; public static void main(String[] args) { foo(7); } public static void foo(int y) { x = y; } } and MonitorX.aj: public aspect MonitorX { before() : set(static int Main.x){ System.out.println(Main.x); } } which doesn't work since I can't access private x using Main.x. I've also tried: before(int t) : set(static int Main.x) && target(t){ System.out.println(t); } which doesn't work either (nothing is outputted, if I try to output string, it seems that the aspect isn't invoked at all). However printing out the new value that is being assigned works: before(int newVal) : set(static int Main.x) && args(newVal){ System.out.println(newVal); } What am I missing?

    Read the article

  • aspect parameter validation [closed]

    - by user12558
    Hi, Im doing a POC using Aspectj. class BaseInfo{..} class UserInfo extends BaseInfo{..} class UserService { public void getUser(UserInfo userInfo){..} public void deleteUser(String userId){..} } I've defined an advice, that gets invoked when I pass an UserInfo instance.But when i try to pass the BaseInfo, the advice is not getting invoked. Below block executes the afterMethod as expected for getUser. &ltaop:pointcut id="aopafterMethod" expression="execution(* UserService.*(..,UserInfo,..))" / &gtaop:after pointcut-ref="aopafterMethod" method="afterMethod" / But when i try to give BaseInfo instead of UserInfo, the aspect is not getting triggered. Am i missing something? Kindly help me on this issue.

    Read the article

  • what is a normal developer to pageview ratio?

    - by Anthony Shull
    I work for an e-commerce site that has lately been shedding its workforce. I was hired ten months ago as a UI Developer. At that time we had three other developers. One was the technical lead who had been with the company for 10 years. The other two were server-side developers who had been there for 10 and 3.5 years respectively. In ten months, the technical lead left for a better position, one developer was laid off, and the other very recently left. So, I am now the only developer on staff. We have one DBA and one network administrator. They are currently looking to hire another developer but are not willing to pay enough to hire a senior person. I consider myself a junior developer with two years of experience. I have argued that we need to hire at least one senior developer and another junior developer if we're going to keep our current site operational (not to mention develop new features)...even if that means laying off staff in other departments. Right now we get 6.5 million pageviews per month, and I feel like 3.2 million pageviews per developer must be incredibly abnormal. My question is then: what is a normal developer to pageview ratio? Are there any industry standards or literature on the subject that I can use to argue for more staff?

    Read the article

  • PHP Calculating Text to Content Ratio

    - by James
    I am using the following code to calculate text to code ratio. I think it is crazy that no one can agree on how to properly calculate the result. I am looking any suggestions or ideas to improve this code that may make it more accurate. <?php // Returns the size of the content in bytes function findKb($content){ $count=0; $order = array("\r\n", "\n", "\r", "chr(13)", "\t", "\0", "\x0B"); $content = str_replace($order, "12", $content); for ($index = 0; $index < strlen($content); $index ++){ $byte = ord($content[$index]); if ($byte <= 127) { $count++; } else if ($byte >= 194 && $byte <= 223) { $count=$count+2; } else if ($byte >= 224 && $byte <= 239) { $count=$count+3; } else if ($byte >= 240 && $byte <= 244) { $count=$count+4; } } return $count; } // Collect size of entire code $filesize = findKb($content); // Remove anything within script tags $code = preg_replace("@<script[^>]*>.+</script[^>]*>@i", "", $content); // Remove anything within style tags $code = preg_replace("@<style[^>]*>.+</style[^>]*>@i", "", $content); // Remove all tags from the system $code = strip_tags($code); // Remove Extra whitespace from the content $code = preg_replace( '/\s+/', ' ', $code ); // Find the size of the remaining code $codesize = findKb($code); // Calculate Percentage $percent = $codesize/$filesize; $percentage = $percent*100; echo $percentage; ?> I don't know the exact calculations that are used so this function is just my guess. Does anyone know what the proper calculations are or if my functions are close enough for a good judgement.

    Read the article

  • How can Domain driven design be combined with aspect oriented programming?

    - by anthares
    I'm doing research and one point I want to cover is "What is the relationship between Domain-driven Design and Aspect oriented programming?" I know that a main principle in DDD is separation of concerns and I understand that. What I'm not really certain is, whether aspects in AOP acts like "sub domains" in our domain in DDD. Are these two concepts, basically the same thing. I mean, If I develop an application following AOP and DDD, at the end of the day will it be true that "a sub domain" == "an aspect". I will also appreciate any other opinions what is the common between AOP and DDD.

    Read the article

  • Windows 7 Boot Screen Resolution/Aspect Ratio

    - by Joe
    I have been using my Windows 7 PC with my 46" Samsung HDTV with 1920x1080 resolution. The boot screen seems to always be at 1024x768 resolution and the aspect ratio doesn't match the 1080p ratio. I read on a msdn blog that microsoft only made the boot screen in one type of resolution so that cannot be changed. The result is that on my TV the boot screen seems to look stretched out. Is there a way to make change the aspect ratio or crop it in someway? Is there any method at all to make it look normal or just better without being stretchy looking?

    Read the article

  • Resize videos with different widths to a fixed height preserving aspect ratio with ffmpeg

    - by Axarydax
    I'd like to convert a lot of video files to flash video for our company's website. I have a requirement that all of the videos must be in 360p format, so their size would be Nx360. FFMpeg uses -s argument to specify target resolution as WxH. I don't know Width, as it depends on source file aspect ratio. If source is 640x480, target will be 480x360. If source is 848x480, target will be 636x360. Is there a way to do it with some switch of ffmpeg? That it will preserve aspect ratio and I'll only specify the height of target video? I could easily solve it by making a program that will launch ffprobe to get source video size, calculate aspect ratio and then calculate a new width.

    Read the article

  • QuickTime X incorrect aspect ratio for H.264 video

    - by Adam Robinson
    I'm running Snow Leopard and have a serious issue with QuickTime X. I have a Samsung HMX-H100N/XAA camcorder that records H.264 video in either 720p or 1080i. In either of these resolutions, QuickTime X (and, by extension, all QuickTime-associated applications like FCP, iMovie, etc.) displays an incorrect aspect ratio for all video produced by this camcorder. For example, 720p video is reported as being 1280x720 in the movie inspector (which is normal), but the displayed size is always at an aspect ratio of something like 63:20 (never heard of such a ratio) with sizes like 1700x539. If I open the video in QuickTime 7 player on the same computer, it is displayed correctly. If I process the video through something like MPEG Streamclip to transcode it, it displays correctly. As it stands right now I have to transcode all of my video in order to use it in any iLive (or other QT-based application) unless I want it to look ridiculous. I've tried installing Perian, but that seemed to have no effect.

    Read the article

  • Updating games for iOS 6 and new iPhone/iPod Touch

    - by SundayMonday
    Say I have a game that runs full-screen on iPhone 4S and older devices. The balance of the game is just right for the 480 x 320 screen and associated aspect ratio. Now I want to update my game to run full-screen on the new iPhone/iPod Touch where the aspect ratio of the screen is different. It seems like this can be challenging for some games in terms of maintaining the "balance". For example if the extra screen space was just tacked onto the right side of Jet Pack Joyride the balance would be thrown off since the user now has more time to see and react to obstacles. Also it could be challenging in terms of code maintenance. Perhaps Jet Pack Joyride would slightly increase the speed of approaching obstacles when the game is played on newer devices. However this quickly becomes messy when extra conditional statements are added all over the code. One solution is to have some parameters that are set in once place at start-up depending on the device type. What are some strategies for updating iOS games to run on the new iPhone and iPod Touch?

    Read the article

  • Are certain problems solved more elegantly with AOP?

    - by Winston Ewert
    I've come across the idea of Aspect Oriented Programming, and I have some concerns with it. The basic idea seems to be that we want to take cross-cutting concerns which aren't well modularized using object and modularize them. That is all very fine and well. But the implementation of AOP seems to be that of modifying code from outside of the module. So, for example, an aspect could be written that changes what happens when a particular object is passed as a parameter in a function. This seems to go directly against the idea of modules. I should not be able to modify a module's behavior from outside of that module, otherwise the whole point of modules are overturned. But aspects seem to be doing exactly that! Basically, aspects seems to be a form of code patching. It may useful for some quick hacks; but, as a general principle perhaps its not something you want to do. Aspect Oriented Programming seems to me taking a bad practice and raising to a general design principle. Is AOP a good practice? Are certain programming problems solved more elegantly with AOP?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >