can you create a new object(type) at runtime?

Forum for plugin, effect and behavior programmers. Please use the Help & Support forum for help using Construct.

Post » Mon Jan 11, 2010 9:47 am

can you create a new object type at runtime?
nothing fancy, let's say, a copy of "sprite", but name it "hello" instead of sprite, and now they can be referred to separately?
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Mon Jan 11, 2010 10:15 am

No, it could potentially make the runtime much more complicated, at the moment it is coded throughout to assume object types never change.

What is the use of this anyway? Why might you need to do that? And how would you make events for an object that doesn't yet exist in the event sheet editor?
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Mon Jan 11, 2010 1:11 pm

i suppose i dont really need it at all
i was going to use python for the new objects
i thought i had remembered someone creating a custom object creator at one point where you could specify names and such.

its for an editor im making. itll still work just saving the object name, and then using those names to choose objects later. just one extra step. forget i asked. :)

i am curious what that plugin i mentioned did though. it was back when iwas fairly new to construct, and afraid to try custom plugs
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Mon Jan 11, 2010 3:04 pm

Were you thinking of this plugin, perhaps? It allows you to create a new instance of an object and give it a custom width, height, and/or angle in one event.
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Mon Jan 11, 2010 4:44 pm

that was the one link, thanks

i think way back when i first saw it, i misread the part where it said create object by name
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Tue Jan 12, 2010 1:25 am

I gave a bone editor a whirl, and found that I couldn't just load images for bones because:

a) I need to know the number of frames ahead of time
b) I need to know the number of different bones ahead of time.

My solution was creating canvases and pasting a "loader" sprite on them, which had a single frame loaded from the selected file.
It worked, no animation support but for animation editing I guess it would do. Size was all wrong and stretchy though, I have to try it with the latest build.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665


Return to Construct engineering

Who is online

Users browsing this forum: No registered users and 0 guests