Optimal WP7 bitmap drawing with XNA - windows-phone-7

I want to display a bitmap on a WP7 in vertical position, but it rotates it 90 degrees and coordinates are in landscape position. Is it possible to make WP7 display everything in vertical mode and make coordinates starting from top left corner in vertical mode? If not, whats the best way to display my bitmaps in vertical mode? Should I rotate my bitmaps when I design them, or should i use rotation in my drawing functions? I use XNA spriteBatch.Draw to draw my bitmaps, but it has some advanced rotation techniques that I don't understand.

XNA apps are based on the assumption that the game will be displayed in landscape mode. Whether it's easier/better for you to rotate things at design time or when displayign them in the app will depend on various factors, including: what the game does; your preferences; the number of items; the impact on movement calculations; etc...

Related

LÖVE viewport like Libgdx

I wonder if LÖVE framework has the same feature like Libgdx's viewport, because this feature were really great when I used Libgdx and I wonder if there's anything similar to do in LÖVE.
About viewports: https://github.com/libgdx/libgdx/wiki/Viewports
If, by viewport, you mean using normalised coordinates (resolution-independant), then yes, LÖVE can do that.
Although it's not available by default in the framework itself, there's always a possibility to add your own features.
You could make a Viewport system using LÖVE's canvases.
Start by creating a canvas with fixed dimensions,
then make your game using percentages of these dimensions instead of regular pixel positioning.
For example, player.x = 80 (left side of the screen) becomes player.x = canvas:getWidth()*.1
Once you've drawn everything into your virtual window -that is- the canvas, you can scale it and render your game to fit any window resolution.
I suggest that you take a look at this library that handles all the scaling stuff for you, once you provide your game's virtual dimensions.

Does adding many game GameObjects in scene (not rendered) inefficient for performance? [Unity]

I'm using Unity 4.6 to develop a 2D game. I want to know if having a lot of GameObjects in the scene (out of the camera's sight) has a considerable influence on performance.
For example, is it efficient to make an scrollable list of names (like 1000 of them)? (each one is a GameObject and has a text, a button etc.)
I mask them in a specified area (for example 10 of them are visible at the same time).
Thanks in advance!
Depends on whether or not the objects have visible components. If they do, the engine will draw them even if they are 'off-camera'. A game object by itself has a pretty light load - a tile based game could have thousands in memory. You'll want to toggle the visibility of sprites if you plan on drawing a large number to the scene off-camera. This is where a SpriteManager comes in. It'll check to see if the sprite is in the camera's rectangle and disabled sprites that aren't. There is a semi-offical exmaple here that is good if a little complicated:
http://wiki.unity3d.com/index.php?title=SpriteManager

How to ensure that re-sizing doesn't break my GUI

I've done a few little games here and there, same for GUI programs but I can't seem to make things re-sizable. Most GUIs handle re-sizing fairly well, but how is this achieved?
Lets say we have a 600x800 window, which has a 100x100 box in the very center, and another identical box 200x above it. If I stretched the window to 1280x720, what algorithm would ensure nothing slips out of place while moving and re-sizing the buttons to the new resolution?
I'd like this to apply to "pixel by pixel" displays, such as drawing a centered quad on the screen is where you tell at which pixel each vertex is, not something scalable such as OpenGL's default matrix.

how to limit an image to it's real shape

How can I use an image that whenever I want to make a collision in XNA, it happens only for area of the shape not around of it.
For example when I use below picture, I want collision detection happens only when arrow in shape is touched.
The collision detection happens in the area in this picture
How can I make limitation for area of image only?
What you can do is also to create two rectangles. That makes the overlapping area (the area there the image isn't but the rectangle) a bit smaller. But if you need to do this pixel excact you have to use the recource-expensive per-pixel-collision.
You shouldn't try restricting the image shape, because regardless of your efforts - you will have a rectangle. What you need to do is work with detecting pixel collisions. It is a fairly extensive topic - you can read more about a Windows Phone-specific XNA implementation here.

WP7 equivalent of Android 9-patch or iOS UIImage rightCapWidth?

I'm working on a WP7 app and can't find any way to stretch an image only at a specific point (repeating that row of pixels). For example, if I have a box with rounded corners I want to stretch it to fill a specific area only I want to stretch just a few pixels in the center (horizontally and vertically) so that the corners are unmodified.
In Android you can do this with a 9 Patch image and in iOS UIImage provides methods such as rightCapWidth.
What's the equivalent for WP7?
Thanks.
There is, currently, no direct equivalent for WP7.
You'll have to adjust the image as you need to for your requirements.
As applying rounded corners to everything doesn't match the Metro design principals for the phone, I expect there is little reason for, or likelihood of, such functionlaity becoming part of the core APIs.

Resources