[Plugin] SpawnName

Post your work in progress addons and get feedback

Post » Wed Nov 05, 2014 6:48 pm

Hey, I previously had this in the "Completed Addons" thread, but when I tested it by exporting to html5 I realized it didn't work. I will just let it sit here just incase I overlooked something else.

I fixed it so it works when exporting to html5 in minified or not minified. Previously I was storing the 'object' names of all the objects in the project on creation, but Construct 2 preview, and exported html5 behave differently.

So if you had a sprite object named "PlayerOne", it would work fine in Construct 2 preview but not when exported. I noticed when it was exported that the "name" of the object was "t0", basically the objects were being renamed. I fixed it by having you include the UID of any instance of the type of object you wanted to create. Then in linear time searching for a match of the UID and storing it with the "name" you passed it. So the initial time cost is linear, but constant time after you encounter that object.

Basically SpawnName is best used in functions, where you pass in "name" and "uid" of the object you want to spawn, or manipulate. You have limited access to position, width, height, opacity, angle, but you are able to spawn an object without knowing what it is ahead of time.

Image

https://www.dropbox.com/s/whgy0deaaojp2xk/SpawnName.zip?dl=0
B
5
Posts: 1
Reputation: 229

Return to Work in Progress Addons

Who is online

Users browsing this forum: No registered users and 1 guest