Bounding boxes uncalibrated / offset in retina display mode - objective-c

I use cocos2d in the game I am developing for iOS.
When running in the iPad simulator or the non-retina iPhone simulator, the bounding box correctly surrounds the sprite.
When I use the retina simulator, the bounding box seems to be offset by a certain amount.
The bounding box no longer surrounds the sprite. This applies to child sprites as well. But since all the boxes are offset by the same amount, the bounding boxes of the child sprites correctly appear within the bounding box of the main sprite. The problem is that all the bounding boxes are offset from the actual sprite.
This seems to be the case for all the sprites on screen. Is there some setting change or code change I need to make to ensure the bounding boxes actually surround their sprite?
I use cocos2d version 1.01

Related

Unity Prevent game objects from resizing when resolution changes

I have a rectangle sprite that animates when a score is reached. Starts offscreen and then move onscreen before moving off-screen again. Works fine. Problem is when I change the resolution for different devices the sprite resizes and doesn't display as intended. The text fields inside the rectangle move outside on some of the resolutions. How can i keep the sprite at the original size regardless of resolution. I have tried Preserve Aspect, Set Native Size, moving anchors but it still resizes. I also tried using a panel.Any Ideas?

Apply Image in Buttons

As A Begineer I've made a Puzzle game and it's working fine in Iphone Simulators.
But problem occurred when I run it in bigger Screen like IPad Air 2.All the picture aren't fitting perfectly in the buttons
(Note that Images are applied on buttons not in the Background of
buttons)
As image size not fit to given size of button, may be due to size concern of aspect fit property of imageview of button. You can try to scale image proportionally to size of imageview of button and get desire result.
You can refer to this link for scale image as proportionally to desired size.
scale Image in an UIButton to AspectFit?

SpriteKit visual Editor bounding box not changing size

In the SpriteKit visual editor for sks files when changing the size of scale of a Color Sprite the bounding box size doesn't appear to change with it.
The green rectangle appears to be correct when resizing an the sprite but when switching between edit mode and simulate mode the green box updates to what is happening when playing the game (in the attached image).
Objects are colliding with the bounding box that doesn't match the sprite shape. The sprite is pinned and is not dynamic or affected by gravity or rotatable.
This is happening in Xcode 6.4 but didn't seem to happen in previous versions of Xcode.

change the color of the clicked pixel

I am writing a Windows Phone 8.1 app. There is a rectangle object in my app and in the Rectangle, I want to change the color of the pixel where user clicks. I have retrieved the pixel coordinates using the PointerPressed event of the rectangle(I retrieved the relative coordinates). My question is what function/method of the rectangle should I use to access the pixel properties so that I can change its color? Thanks
You can do any of the 2 things.
Use Canvas instead of the Rectangle, in click handler create some shape object (e.g. ellipse or path), add that element to the Canvas' children, specifying correct position with Canvas.SetTop / Canvas.SetLeft static methods.
Fill your rectangle with an ImageBrush constructed from a WriteableBitmap, write pixel values in the WriteableBitmap.
If your user will only paint a few pixels, Canvas + shapes approach is more efficient. If you expect your user will paint many pixels, WriteableBitmap is better.
P.S. Don't forget there're devices out there with 1080×1920 px screens, such as Nokia Lumia Icon, Lumia 930, Lumia 1520, Samsung ATIV SE. Individual pixels will be invisible on those devices.

How to build a Head Up Display in OpenSceneGraph that resizes depending on the screen's resolution?

I'm pretty new to OpenSceneGraph and I have the following problem:
I'm trying to build a 2D Head Up Display out of several images, so that it can resize depending on the screen's resolution. That means I have extra images for the corners and one image for the bar that connects the corners and so on.
Well, that's the idea. But I have no clue how to do that in OpenSceneGraph.
Can anybody help me?
So, when the window resizes, you'll get an event from osgViewer telling you about the change.
You need to resize your viewport when the window size changes, so your HUD geometry has some idea of what the pixel-size of the display is (most of the HUD examples setup for a nominal 1024x768 screen and then just let that stretch around as the window is resized, pretending like the new viewport is still 1024x768).
Once you've resized the viewpoer, you need to rearrange your geometry. Your corner pieces need to be laid out at the fixed pixel size you want them to always appear, then you need your connecting elements to change size, horizontally or vertically, to fill the space between the corner pieces. You usually rely on texture stretching or repeating to fill the space as the piece of geometry gets stretched.
If none of that makes any sense, I can describe more.