Menu

CocosSharp – All About Positioning

CocosSharp – All About Positioning.
This post is part of my series.
to catch up.
This series was inspired by the things I learned developing a new game for and called.

CCNode’s Position property is of type CCPoint

CCPoint is a simple struct with x and y properties

each of type float.
, your game’s dimensions are logical dimensions that don’t necessarily map to pixels.
Therefore, the positioning used in CocosSharp uses floats for coordinates so that you can have much more precision than integers would provide.
public class RootLayer : CCLayer { public RootLayer() { var nodeA = new CCNode(); AddChild(nodeA); var nodeB = new CCNode(); nodeA.
AddChild(nodeB); } } 1 2 3 4 5 6 7 8 9 10 11 nodeA.
Position = new CCPoint(10, 20); nodeB.
Position = new CCPoint(25, 35); 1 2 3   , , , , , , Leave a Reply Cancel reply.
Required fields are marked Name Email My name is Brent Edwards and I am a Principal Lead Consultant for.
I specialize in.
NET and Xamarin development.
I am also the author of , a fun and challenging take on maze games for Android and iOS, .

Written with Xamarin and CocosSharp

Check me out on , , , and.
(1).
(3).
(2).
(4).
(1).
(1).
(16).
(13).
(1).
(6).
(9).
(1).
(1).
(1).
(2).
(1).
(2).
(1).
(5).
The opinions expressed herein are my own personal opinions and do not represent my employer”s view in any way.

Tags: , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *