ios - Device Orientation results in flipped node location -


my code simple. want change positioning of skspritenode remain in bottom right corner of device screen. call uideviceorientationdidchangenotification method "rotated" on device rotation , should move node, reason flips desired location landscape position portrait should , vice-versa.

my code follows:

ui

    - (void)rotated:(nsnotification *)notification {             deviceorientation deviceorientation = [uidevice currentdevice].orientation;             if (uideviceorientationislandscape(deviceorientation) && !_isshowinglandscapeview)                 [self.node setposition:bottom_right];                 _isshowinglandscapeview = yes;             }             else if (uideviceorientationisportrait(deviceorientation) && _isshowinglandscapeview)             {                 [self.node setposition:bottom_right];                 _isshowinglandscapeview = no;             }         } 

ok i'm doing simple. use uibuttons on skscene. go uiviewcontroller call skscene , add buttons. you'll have use nsnotification center pass information buttons, labels, etc.

http://www.raywenderlich.com/forums/viewtopic.php?f=2&t=8843


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -