last day (14 days later) » 

12:20 PM
0
Q: How do I detect if a label node is not in the scene?

SquidI have a bunch of label nodes with physicsbodies, that sometimes glitch out of the screen for some reason. Whenever that happens I want them to come back. I tried this by detecting when their x and y are greater than the screen or less. This didn't work because every label is a child of a labelc...

 
I would focus on what this glitch is and how to fix it instead of trying to re-adjust their position.
 
Yeah, well I can't really fix it since it's a problem with the framework. I just have physicsbodies I can move with my finger and when I keep trying to push them out of the frame they eventually go through. The scene has an edgeloop physicsbody
 
Are you adding your nodes as children to self or to a worldNode?
 
im adding em to self
 
So why do you have a problem detecting coordinates relative to the self.view?
 
12:20 PM
Sorry, I'm adding the labelcontainer to self, the labels themselves are being added to the labelcontainer
 
Squid?
 
im here
 
so you add a node to self view and then add children to that node?
 
I have like 10 labels and I add them to a node
Then i add that node to the scene
 
ok. let's say that you add your parent node to self.view position x=300 and y=300. ok so far?
 
12:22 PM
yeah
 
your screen view size is 600 by 400
 
right
 
then you add a child to the parent at let's say 50,50
 
ok
 
that puts the child at parent x (300) + 50
making it 350 in self view x coordinate
 
12:24 PM
isnt the origin in the middle?
 
so you can take the parent x then add the child x in relation to the parent and you have the child's x position in the view
origin is in the middle
 
yeah ok
thx
great
 
see what i am getting at?
 
yeah
 
that allows you to do a position check
 
12:27 PM
what level do you have to be to start a chat?
 
not sure. for me it just kinda popped up whenever i posted too many comments
 
oh okay
 
so you good?
 
yeah
r you going to wwdc15?
I might be
 
noooooo. honestly i can't justify spending almost $1,600 on just the ticket to get in.
 
12:30 PM
Yeah i get that
Im trying for a scholarship
 
but if you're going, have a blast and steal some good code :)
 
Haha I will
 
late rdude
 
later
 

last day (14 days later) »