Set imagepoint + 50 on X

Get help using Construct 2

Post » Sat Jul 06, 2013 8:21 pm

Hi

How can I spawn object i Imagepoint 4
and align it +50 pixel to the right on X


/Flemming
B
33
S
17
G
11
Posts: 350
Reputation: 8,695

Post » Sat Jul 06, 2013 8:45 pm

Use a variable to hold the position info. Example:

1) Declare variables xPoint,yPoint
2) Pick object that has the imagepoint 4 you want to use (otherwise you can't access that info)
3) xPoint = PickedObject.ImagePointX(4)+50
   yPoint = PickedObject.ImagePointY(4)
4) Spawn object at xPoint,yPoint
Venivididormi2013-07-06 20:47:48
B
8
S
2
Posts: 63
Reputation: 1,223

Post » Sat Jul 06, 2013 9:24 pm

Hi thanks for reply


1) Declare variables xPoint,yPoint

Ive created these global variable



2) Pick object that has the imagepoint 4 you want to use (otherwise you can't access that info)

Cant find the pick object event ?



3) xPoint = PickedObject.ImagePointX(4)+50
   yPoint = PickedObject.ImagePointY(4)
4) Spawn object at xPoint,yPoint
B
33
S
17
G
11
Posts: 350
Reputation: 8,695

Post » Sun Jul 07, 2013 12:20 pm

There are a number of ways to pick the object, but they're also picked automatically after spawning them. So in your example, just spawn the object that contains the imagepoint you want to use to spawn something else. So for example:

1) Declare variables xPoint,yPoint
2) spawn objectName (which contains imagepoint 4) at whatever XY you want
3) xPoint = objectName.ImagePointX(4)+50
   yPoint = objectName.ImagePointY(4)
4) Spawn second object at xPoint,yPoint

Or, am I completely misunderstanding you and you just want to spawn the object centred on its own imagepoint 4?

Venivididormi2013-07-08 00:45:07
B
8
S
2
Posts: 63
Reputation: 1,223


Return to How do I....?

Who is online

Users browsing this forum: Baidu [Spider], divsyntax, pmerineau and 8 guests