How do I copy image of sprite to another sprite at runtime?

Get help using Construct 2

Post » Sat Jan 30, 2016 6:28 pm

Hi all,

can someone please help on that ?
In my -let's say- game, I have a sprite called "a" and I have some other hidden sprites "b1", "b2", "b3"
Sprite "a" is blank (white image) when game starts.
The other 3 "b" sprites have from one different image each.
How can I make it so that when I press a button, to load the image from sprite b1 or b2 or b3 to sprite a ?

Is there some command like a.image = b1.image or maybe a.loadimagefromsprite(b) or anything similar ?

Thank you.
B
5
S
1
Posts: 21
Reputation: 1,030

Post » Sat Jan 30, 2016 7:09 pm

I think you only can do it with the screenshotting function, or easier, with the canvas or paster plugin. The key then is pasting the b1 b2 or b3 onto the canvas/paster and then use the image url of canvas/paster in the load from url expression of the sprite a.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Sat Jan 30, 2016 7:16 pm

mindfaQ wrote:I think you only can do it with the screenshotting function, or easier, with the canvas or paster plugin. The key then is pasting the b1 b2 or b3 onto the canvas/paster and then use the image url of canvas/paster in the load from url expression of the sprite a.

Thank you for replying - but I would expect some more low-level way to copy an image from sprite to sprite.
On the other hand I have searched all features and could not find something appropriate...
B
5
S
1
Posts: 21
Reputation: 1,030

Post » Sat Jan 30, 2016 8:53 pm

Can't you accomplish what you're trying by having "a" have a lot of animations? "Copying" frames is impossible (been using C2 since it came out), you can't dynamically change sprites' images, hotspots or collision boxes
B
83
S
22
G
15
Posts: 1,039
Reputation: 15,219

Post » Mon Feb 08, 2016 10:14 am

You can use load image from URL, but then you have to load the images all from URLs I presume.
We make Facebook games!

Please contact us if you want to work with us to release your game on Facebook - our team have generated millions of installs for our own C2 and Flash games, and we can do revenue-share deals with YOU, too!

https://u1stgames.com
B
12
S
2
Posts: 79
Reputation: 819


Return to How do I....?

Who is online

Users browsing this forum: AkbarAsgharMG, cjbruce and 6 guests