[Plugin] SpawnName

0 favourites
  • 1 posts
From the Asset Store
[C2] [C3] support C3 build service | support Banner ads, Interstitial ads, Rewared video ads.
  • 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.


  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)