### Torque 2D Editor Work

2D version of the Torque engine.

Moderator: marauder2k9

• 1
• 3
• 4
• 5
• 6
• 7

#### Re: Torque 2D Editor Work

marauder2k9
Posts: 418
Joined: Wed Feb 18, 2015 7:36 am
LATEST PUSH

Latest update includes the ability to change the camera size for the scene. This update also comes with a few fixes on how scaling is applied, now you can resize the window and objects should look the same no matter what. This is done by scaling the camera rather than objects. The camera outline should still be used for reference as this represents what the end user will see. If you wish to use this function in your product it will require testing on multiple devices to make sure unsightly blackness is not visible to the end user.

ParticlePlayer asset property guis are in place and ready to be linked up next gui update will include the particle player creation button. Then once particle player is all done the next object to be created will be the TextSprite.

#### Re: Torque 2D Editor Work

marauder2k9
Posts: 418
Joined: Wed Feb 18, 2015 7:36 am
Animation builder fixes

Now the animation loop checkbox will not crash when pressed without frames in the frame stack and you can create multiple animations from the same imageasset without closing the window. Unfortunately now looping cannot be visualized for some reason. When i have it set up to visualize it it keeps trying to get a to a frame that doesnt exist and then the animation gets deleted.

#### Re: Torque 2D Editor Work

marauder2k9
Posts: 418
Joined: Wed Feb 18, 2015 7:36 am
Text Sprite

So the next object to be added is going to be the text sprite. This presents a few problems first and foremost the font asset. This asset is very tricky to make a creator for. Its not as simple as the imageasset or animationasset etc. The problem is font assets need an fnt file that then points to png files and the fnt file has a line for each character represented like this

code snippet from Arial.fnt file:-
char id=32   x=507   y=0     width=3     height=1     xoffset=-1    yoffset=127   xadvance=32    page=0  chnl=15
I think making people have to build this file through an editor would just cause more problems than it will fix as this file can be created outside of torque with BMFont.

Running your ordinary font file through this program will automatically set the different font characters automatically and generate png files as well.

At this point a creator to create fontassets wouldnt be very intuitive and because of the 100s of characters in a font it would probably cause more problems than it would fix.

#### Re: Torque 2D Editor Work

marauder2k9
Posts: 418
Joined: Wed Feb 18, 2015 7:36 am
LATEST PUSH:

Okay i know i said i was going to work on the TextSprite asset next but due to my own Game needs i had to work on Behaviors instead. So latest push now has the ability to select behaviors for SpriteObjects.

When you add a behavior it will automatically create a gui for each behavior object that will let you set the values for the behavior fields. If your behavior spawns objects there is a small change you will need to implement.

Using spawnArea in the DeathballToy as an example after all the defaults for the %clone are set In the spawn function you will need to add:-
   %scene = %this.owner.getScene();
%scene.add(%clone);

#### Re: Torque 2D Editor Work

marauder2k9
Posts: 418
Joined: Wed Feb 18, 2015 7:36 am
Small error

Because of the way the behavior fields are setup for sprites if you have a behavior field that has 2 words in its value it will cause problems

For example the spawnGroup behavior has an enum for spawnLocation of Horizontal Line and Vertical Line. In order to keep behaviors to one dynamic field on each object these fields are set for one word per field. Otherwise each field of a behavior will become a dynamic field on the object. So changing the behavior to be Horizontal or Vertical instead fixes the issue and the behavior works as designed.

#### Re: Torque 2D Editor Work

marauder2k9
Posts: 418
Joined: Wed Feb 18, 2015 7:36 am
Latest Push:

Fixed the error in the previous post. Also now if you load a behavior that takes an enum value it will automatically create a popup menu ctrl with all the selections made available.

#### Re: Torque 2D Editor Work

trident
Posts: 12
Joined: Wed Feb 18, 2015 11:58 pm
you been busy and thanks for the update of what you doing it great to read

#### Re: Torque 2D Editor Work

marauder2k9
Posts: 418
Joined: Wed Feb 18, 2015 7:36 am
Thanks. There's a lot more to come. I have added a fix so that when an object is locked any object of the same type will show its menu, a silly oversight on my part objects need to be checked on select. there was also an error in the polyeditor that i havent narrowed down yet. When you create a polyshape sometimes when trying to change the values in the guitexteditctrls it will close the window. Touches shouldn't be getting passed through to the scene underneath. Particle Emitter creator only creates particles at 0.0 atm and while i thought it was a good idea to have the particles in the scene after using it a bit i think its best to move this to a separate window. Only problem is scaling the particles properly

#### Re: Torque 2D Editor Work

marauder2k9
Posts: 418
Joined: Wed Feb 18, 2015 7:36 am
Latest Update

Thought i would write a little bit giving an update on how things are going. For the last month i have been fixing and updating one of my releases and working on a couple of new ones. The editor has made this a lot quicker but i have found quite a few problems that i have been fixing along the way but i have remained focused on finishing my own projects for this reason i have been a little quiet here and i apologize for that.

The good thing that came from this is i have been updating and fixing problems a long the way things that i found easier to work with throughout developing my own apps and games. The new features that will be added as soon as i finish these products and get them out are as follows:

New Main window - now there is a scene list that has every object in the scene added to it, this includes joints and force controllers with the options for hiding them and locking them. At first i thought this may take up too much screen real estate but it became more and more necessary throughout development to be able to select objects etc.

Move to Object - Now with the scene list you can select objects and modify their settings(fairly standard stuff) but now also you can move the camera to that object.

Camera Layer - A few changes have been made to the camera but one thing i found quite useful is the ability to choose which layer to make visible. This is only used in the editor any output from the editor will render all layers.

Camera Link - Now you can link the camera to an object and set the link properties. These settings are only visible when the scene is playing as the camera object in the scene becomes the settings for the scene window to help visualize the settings and how a game might play out.

Triggers Added - Now triggers have been added as a visual but only a visual unfortunately. The scripting for how these triggers work is being confined to simple behaviors. So for example you would have a change level behavior for a trigger that will let you choose which scene to switch to when the trigger has been entered. Now these triggers are only going to work when the level is exported for obvious reasons. Not good when testing a scene and it changes when your character enters a trigger.... not fun... it happened more than once lol

Extra Menus - Now there are extra menus for handling how a module operates and how a scene operates. For example you can now press F2 to bring up scene specific settings such as gravity batch render settings etc and press F1 for module settings that so far only really has a setting for choosing what the default scene is.

Particle Asset - this was a difficult one but now creating particle assets now takes you to a completely empty scene with the same camera settings as the scene you are working on so scaling can work. This seemed more and more necessary the more and more i worked on a level as a level became more populated.

Scene Object menu - Now this one was difficult to come to terms with. As you may know if you went through the source code of the EditorToy every object was separated out because each object required different settings but they all shared certain settings. For example everything a sprite has access to a scroller has access to they just have specific settings for scrolling the image. So now every object specific menu has been moved to one file. A check is made when an object is selected to see which type of object is selected and a new menu item loads for the specific settings for that object so for example every setting that is available for a sprite is available for the scroller but now the scroller has a specific scrolling section for the scroll settings. This works faster for the editor. The other file that will need work soon is the ParticleAsset creation. While moving it off to a separate window it still has about 100 calls to completely similar settings that should be able to be simplified such as all the data keys. While they work well at the moment you just have to look at the size of the file for the particle asset. Thats a lot of code to call for one file and while i haven't experienced any slow down working on a particle asset it is an accident just waiting to happen. So i am planning on re-working the particle asset gui and data keys to be procedural. Really you don't need 4 keys being handled if you only have 2 keys with settings in them.

A bunch of other fixes have been made in the background and i still haven't really figured out a good way to modify assets that have already been made. But the answers are being worked on and may become a reality as the longer you work on a project the more and more you need to modify assets. While it is quick and easy to just add a new asset for images and sounds, working with animations is a little trickier the more you play your game you notice this could use an extra frame here or a frame less there and having to create a brand new asset and then go through each object and change it to the new animation asset is a little tedious.

Big things are on the horizon. Time wise i will be hoping to get all these changes up before the End of June. I am still dedicating most of my time to finishing my current projects. These changes were worked on in the background. They may have some serious problems that i haven't noticed but they seem to be a lot better for the time being.

#### Re: Torque 2D Editor Work

trident
Posts: 12
Joined: Wed Feb 18, 2015 11:58 pm
love reading what you doing and can not wait to play with it all and break it (hope not )
keep it up
• 1
• 3
• 4
• 5
• 6
• 7

#### Who is online

Users browsing this forum: No registered users and 1 guest