Pages: « 1 2 3 4 5 6 7 8 9 »
  Print  
Author Topic: Improving rooms editor  (Read 70353 times)
Offline (Male) Goombert
Reply #60 Posted on: August 08, 2014, 05:52:19 pm

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 2993

View Profile
No I can guarantee you that Studio probably rotates around the sprite center, whatever the defined behavior of image_angle is.
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) egofree
Reply #61 Posted on: August 09, 2014, 02:26:40 am
Contributor
Joined: Jun 2013
Posts: 601

View Profile Email
It depends of the 'origin' of the sprite. By default the origin is 0,0. Here is an instance at 32, 32:



With a rotation of 160 :



But if you set the origin around the center, you are right. But this is bad news, i didn't take into account yet this property.
« Last Edit: August 09, 2014, 02:32:48 am by egofree » Logged
Offline (Unknown gender) TheExDeus
Reply #62 Posted on: August 10, 2014, 01:25:14 pm

Developer
Joined: Apr 2008
Posts: 1860

View Profile
Rotation around origin together with flipping should be as easy as this:
Code: [Select]
g2.setToIdentity(); //Set everything to default. This should also be true in general before any translation
g2.translate(-g.xoffset,-g.yoffset); //So move to 0-xoffset (xorigin),0-yoffset (yorigin)
g2.scale((xflip==true?-scale.getX():scale.getX()),(yflip==true?-scale.getY():scale.getY()));
g2.rotate(Math.toRadians(-rotation));
g2.translate(g.x,g.y); //Translate to instance position

So the order is translate the origin, scale, rotate and translate to position.

Flipping is not rotation and translation - well it is, but it's the same as scale- so scale by negative amount and it's flipping. Try inputting -1.00 in Scale X, it should show the same as Flip X. I don't know how GM handles that fact (does it allow Scale X to be negative?), but I think we should allow it to be negative and Flip X to be enabled at the same time. It's useless, but still.
« Last Edit: August 10, 2014, 01:32:20 pm by TheExDeus » Logged
Offline (Unknown gender) egofree
Reply #63 Posted on: August 13, 2014, 02:24:31 pm
Contributor
Joined: Jun 2013
Posts: 601

View Profile Email
I've finished to implement scaling, rotation and alpha property. It was a pain in the *** to integrate correctly all these properties, especially with the sprite's origin. :D
If some people would like to test my latest version : https://dl.dropboxusercontent.com/u/29802501/lateralgm.jar. This is work in progress and it is made just to test the new properties in the rooms editor. It is not working yet within ENIGMA, and i need to add missing features, like the undo. I need also to be sure that they are saved correctly in project files. I am working right now on the image blending with colors.
« Last Edit: August 13, 2014, 02:30:07 pm by egofree » Logged
Offline (Male) Goombert
Reply #64 Posted on: August 13, 2014, 11:11:24 pm

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 2993

View Profile
Alright egofree, just a heads up I am planning to update the Portable ZIP this weekend possibly Friday when classes end.
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) egofree
Reply #65 Posted on: August 19, 2014, 10:53:13 am
Contributor
Joined: Jun 2013
Posts: 601

View Profile Email
The reading of GMX files with the new properties is implemented. I created a project in GM Studio :



And then i open it in LateralGm:

Logged
Offline (Unknown gender) egofree
Reply #66 Posted on: August 23, 2014, 02:55:28 pm
Contributor
Joined: Jun 2013
Posts: 601

View Profile Email
I've finished the work on LateralGM and the modifications for the new properties are now in the repository : https://github.com/IsmAvatar/LateralGM/pull/138

In order to integrate the new properties in Enigma, the following tasks must be finished in the LateralGm plugin :  changing the new instance's properties (image_xscale,image_yscale,image_alpha,image_angle) in the new property : pre_creation_code. Also these properties must be supported when reading and writing egm files. But anyway i consider the work to be finished in LateralGM, and there is not much remaining work to be finished. About 90% of the work is already done.
« Last Edit: August 23, 2014, 03:12:08 pm by egofree » Logged
Offline (Male) Goombert
Reply #67 Posted on: August 23, 2014, 10:14:26 pm

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 2993

View Profile
Very nice ego, keep up the good work, I am still pressed for time, even more so now.
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) egofree
Reply #68 Posted on: August 27, 2014, 03:58:21 am
Contributor
Joined: Jun 2013
Posts: 601

View Profile Email
I've finished everything for the new properties. Here is a test project :



and the result, when running :



But this was done only for testing purpose with modifying the creationCode. But in my pull request (https://github.com/enigma-dev/lgmplugin/pull/27), i am not modifiying creationCode but the new property preCreationCode. Currently, it will give the following error :

Code: [Select]
Stack trace:
java.lang.Error: Invalid memory access
at com.sun.jna.Native.invokeInt(Native Method)
at com.sun.jna.Function.invoke(Function.java:383)
at com.sun.jna.Function.invoke(Function.java:315)
at com.sun.jna.Library$Handler.invoke(Library.java:212)
at com.sun.proxy.$Proxy0.compileEGMf(Unknown Source)
at org.enigma.EnigmaRunner$CompilerThread.run(EnigmaRunner.java:679)

But i am rather confident it is because the ENIGMA engine must be modified in order to take into account the new property.
« Last Edit: August 27, 2014, 06:07:38 am by egofree » Logged
Offline (Unknown gender) TheExDeus
Reply #69 Posted on: August 27, 2014, 06:29:40 am

Developer
Joined: Apr 2008
Posts: 1860

View Profile
Did you modify enigma.jar as well? If so, then compile both and post here. I will download them and try to add the precreation code.
Logged
Offline (Unknown gender) egofree
Reply #70 Posted on: August 27, 2014, 06:53:59 am
Contributor
Joined: Jun 2013
Posts: 601

View Profile Email
Yes, i've modified both. Here is the latest version of enigma.jar and LateralGm.jar :

https://dl.dropboxusercontent.com/u/29802501/lateralgm.jar
https://dl.dropboxusercontent.com/u/29802501/enigma.jar

I don't know if the fields order is important for you or not, but the preCreationCode is declared just after the creationCode.
« Last Edit: August 27, 2014, 08:26:06 am by egofree » Logged
Offline (Unknown gender) time-killer-games
Reply #71 Posted on: August 27, 2014, 01:04:10 pm
"Guest"


Email
Ego free I was going to upgrade to windows 8 but I've heard a lot of bad things about it so no promises until after I hear you are interested, thanks to your contribution that I've waited so long for I'd like to reward you a donation from about $20-$40. I offered this to Robert in times past but he wanted me to use the money for something better.

I want everyone to know this when I offer donations I do it as a joy not a burden. I really like to share the love. What I get out of it is the pleasure to help someone who has helped me greatly. :) I like to make people happy. It makes me happy to see people happy. :D

HAPPY HAPPY JOY JOY HAPPY HAPPY JOY
« Last Edit: August 27, 2014, 01:07:05 pm by time-killer-games » Logged
Offline (Unknown gender) Darkstar2
Reply #72 Posted on: August 27, 2014, 01:55:49 pm
Member
Joined: Jan 2014
Posts: 1238

View Profile Email
Ego free I was going to upgrade to windows 8 but I've heard a lot of bad things about it so no promises until after I hear you are interested, thanks to your contribution that I've waited so long for I'd like to reward you a donation from about $20-$40. I offered this to Robert in times past but he wanted me to use the money for something better.


I think this amazing contributor needs more than donations, he should acquire YYG and remake GMS  :P

Now imagine if ENIGMA was a closed sourced project and running alongside GMS........it would have been good for BOTH sides.......GMS would have been far better than the over priced pile of poo that it is, and ENIGMA would have been far better off, full time development on board, constantly evolving, and UNIQUE on its own, :P

Quote
What I get out of it is the pleasure to help someone who has helped me greatly. :) I like to make people happy. It makes me happy to see people happy. :D

HAPPY HAPPY JOY JOY HAPPY HAPPY JOY

Yeah I agree with TKG...... I guess there are situations when giving is better than receiving..........well in most cases yea....:D

Logged
Offline (Unknown gender) egofree
Reply #73 Posted on: August 27, 2014, 02:30:13 pm
Contributor
Joined: Jun 2013
Posts: 601

View Profile Email
Thanks guy !  :) I just hope the new features will work for you and will not have too much bugs, otherwise i am afraid you will be less grateful !  ;)
This is the first time i am participating in an open project, and i have a lot of pleasure to do it. As i've a lot of fun, i don't notice how time flies.
Time-killer-game, thanks for you donation, but i don't need it, as i am not doing it for money. Use this money to have a good diner or to watch an interesting movie ! :)
As this seems the time of thanking everybody  :D, i would like to thank all developers who have worked on this project and specially Robert. If i started to work on this project it is mostly because of Robert, with all the efforts he made on this project and all the help he gave on this forum. (Y)
« Last Edit: August 27, 2014, 02:33:28 pm by egofree » Logged
Offline (Unknown gender) TheExDeus
Reply #74 Posted on: August 28, 2014, 11:12:45 am

Developer
Joined: Apr 2008
Posts: 1860

View Profile
Test this: https://github.com/enigma-dev/enigma-dev/pull/809
You will have to recompile the .dll. I do it by opening Git Shell and typing "mingw32-make". After that the plugin error shouldn't show and the transformation options should work fine.

Also, I noticed that there is some weirdness when using "inverted colors" option together with instance sprite transformations. And "color" should be used instead of the english spelling. Just to be more consistent. And you could maybe have a "preCreation code" modifiable just like creation code is, for both the instance and rooms. So the transformations are prefixed to the user made precreation code.

Also you should allow negative scale (right now it doesn't allow you to set -1 in scale for example). If you had that I wouldn't need the "flip" option, which is also missing now.
Logged
Pages: « 1 2 3 4 5 6 7 8 9 »
  Print