SOLVED-Copy sprites from another layout at runtime

For questions about using Classic.

Post » Fri Aug 12, 2011 1:29 pm

Is that possible? I mean: If you have a Street Fighter game, can you load characters and scenes based on previews character selection menu?
I know that you can load from images on hd, but would be great to load from another layout, where you have the character already constructed.
Any alternative?Aritz2011-08-12 22:19:02
B
30
S
15
G
10
Posts: 285
Reputation: 7,144

Post » Fri Aug 12, 2011 2:40 pm

Hi Aritz.
In your event sheet all you need do is create the condition for which you want to create the character (eg. on start of layout) then select 'Create Object' under 'System'. Then just choose the character and select the location :)
The best way to handle this however is to probably create a 'spawn' object and copy this across layouts and make an event that spawns that character at that object, then include that event sheet in each layout so you don't have to worry about it each time. Hope that's helpful!
B
14
S
2
G
6
Posts: 52
Reputation: 3,633

Post » Fri Aug 12, 2011 5:27 pm

With 'Create Object' or 'Spawn Object' you can only create or duplicate objects existing in the current layout.
B
30
S
15
G
10
Posts: 285
Reputation: 7,144

Post » Fri Aug 12, 2011 5:48 pm

You can either make the event in the event sheet of the layout with the object or an event sheet not tied to any layout (they list all objects) and copy it over, or you can temporarily make the object global, listing it in all layouts, make the event, then turn it not global again.
Moderator
B
87
S
32
G
33
Posts: 3,005
Reputation: 27,397

Post » Fri Aug 12, 2011 6:38 pm

Sorry I meant to state that I did mean in a non layout-linked event sheet, oops!
B
14
S
2
G
6
Posts: 52
Reputation: 3,633

Post » Fri Aug 12, 2011 10:17 pm

Thanks, I have solved it using "Load/unload layout textures" action. It loads any object from another layout, so you can make layout as a sprite palettes to load sprites as needed.
B
30
S
15
G
10
Posts: 285
Reputation: 7,144


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests