Goombert
 Joined: Jan 2013
Posts: 2,991
|
 |
Reply #60 Posted on: August 08, 2014, 10:52:19 PM |
|
|
|
No I can guarantee you that Studio probably rotates around the sprite center, whatever the defined behavior of image_angle is.
|
|
|
egofree
 Joined: Jun 2013
Posts: 601
|
 |
Reply #61 Posted on: August 09, 2014, 07:26:40 AM |
|
|
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.
|
|
|
TheExDeus
 Joined: Apr 2008
Posts: 1,860
|
 |
Reply #62 Posted on: August 10, 2014, 06:25:14 PM |
|
|
|
Rotation around origin together with flipping should be as easy as this:
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.
|
|
|
egofree
 Joined: Jun 2013
Posts: 601
|
 |
Reply #63 Posted on: August 13, 2014, 07:24:31 PM |
|
|
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.  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.
|
|
|
Goombert
 Joined: Jan 2013
Posts: 2,991
|
 |
Reply #64 Posted on: August 14, 2014, 04:11:24 AM |
|
|
|
Alright egofree, just a heads up I am planning to update the Portable ZIP this weekend possibly Friday when classes end.
|
|
|
egofree
 Joined: Jun 2013
Posts: 601
|
 |
Reply #65 Posted on: August 19, 2014, 03:53:13 PM |
|
|
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: 
|
|
|
egofree
 Joined: Jun 2013
Posts: 601
|
 |
Reply #66 Posted on: August 23, 2014, 07:55:28 PM |
|
|
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/138In 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.
|
|
|
Goombert
 Joined: Jan 2013
Posts: 2,991
|
 |
Reply #67 Posted on: August 24, 2014, 03:14:26 AM |
|
|
|
Very nice ego, keep up the good work, I am still pressed for time, even more so now.
|
|
|
egofree
 Joined: Jun 2013
Posts: 601
|
 |
Reply #68 Posted on: August 27, 2014, 08:58:21 AM |
|
|
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 : 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.
|
|
|
TheExDeus
 Joined: Apr 2008
Posts: 1,860
|
 |
Reply #69 Posted on: August 27, 2014, 11:29:40 AM |
|
|
|
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.
|
|
|
|
|
time-killer-games Guest
|
 |
Reply #71 Posted on: August 27, 2014, 06:04:10 PM |
|
|
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.  HAPPY HAPPY JOY JOY HAPPY HAPPY JOY
|
|
|
|
|
egofree
 Joined: Jun 2013
Posts: 601
|
 |
Reply #73 Posted on: August 27, 2014, 07:30:13 PM |
|
|
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  , 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. 
|
|
|
TheExDeus
 Joined: Apr 2008
Posts: 1,860
|
 |
Reply #74 Posted on: August 28, 2014, 04:12:45 PM |
|
|
Test this: https://github.com/enigma-dev/enigma-dev/pull/809You 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.
|
|
|
|