0

In my project I mix SKView with standard NSView objects in 1 window. And now I trying to take some information from SKscene (mouseDown location) and show it in label near skview object. I tried to use global variables and assign value for it in skview method

-(void)mouseDown:(NSEvent *)theEvent{
   CGPoint location = [theEvent locationInNode:(self)];  
  // location = (10, 15) - example
   currentPointPosition = CGPointMake(location.x, location.y); 
  //currentPointPosition = (10, 15)
}

but when check it from nsbutton, like this:

- (IBAction) updateButton:(id)sender {
  NSLog(@"currentPoint over skview methods: 
  %0.3f : %0.3f", currentPointPosition.x, currentPointPosition.y);
  //currentPointPosition = (0, 0)
  //other code
}

...it remain like after init (annul).
Is it even possible to mix these techs?
ps: sorry for my english
Project screen: http://s8.postimg.org/kdmu36h6d/2014_09_19_20_02_30.png

Dude
  • 21
  • 5
  • Is the problem that currentPointPosition is 0x0? Then post how and where you declared that variable. – CodeSmile Sep 19 '14 at 19:05
  • @LearnCocos2D, currentPointPosition declared in .h file, in Interface. Also I tried declared it as Property, but it doesn't work. – Dude Sep 20 '14 at 11:21
  • Okay, and where and how do you assign a position to it? If you don't assign anything to it it will be 0x0. – CodeSmile Sep 20 '14 at 19:16

0 Answers0