ORIGIN, _ORIGIN, How to set picture origine???

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,623
Reaction score
1,439
First Language
French
Primarily Uses
RMMV
Someone would have an idea to set the origin point of an image.
I would like  anime picture with rotation with custom origin.
But I need define the point of origin, other than original (top left and center.)


I find something in the core, but being beginner in java ...


logically it should be like her ???


Originetest= [20,10];


$gameScreen.showPicture(pictureId, name, Originetest, x, y, scaleX, scaleY, opacity, blendMode);


or maybi ?


$gameScreen.showPicture(pictureId, name, [20,10], x, y, scaleX, scaleY, opacity, blendMode);


I found this in core ?


_updateLayerPositions = function(startX, startY) {
var m = this._margin;
var ox = Math.floor(this.origin.x);
var oy = Math.floor(this.origin.y);
var x2 = (ox - m).mod(this._layerWidth);
var y2 = (oy - m).mod(this._layerHeight);
var w1 = this._layerWidth - x2;
var h1 = this._layerHeight - y2;
var w2 = this._width - w1;
var h2 = this._height - h1;




Also , do you know if RMMV 1.3 will have so good feature for work with picture ?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
How about changing the picture in a way that the true center is the point you want to rotate around?


That way you won't need any javascript.


Example: if you have a picture with a size of 30x100 and you want to rotate that picture around the coordinate [10,20], then use photoshop or GIMP or so to increase the size of the picture to 40x160 (be careful to extend the canvas to left and up instead of resizing), and using center coordinates it will look as if it rotates around the point you've selected, even if in reality a much larger picture (with a lot of transparent parts) rotates around its center.


The mathematics for resizing depending on your offset and the work in the image program might be tricky, but that way there is no need for javascript, everything will be pure eventing.
 

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,623
Reaction score
1,439
First Language
French
Primarily Uses
RMMV
How about changing the picture in a way that the true center is the point you want to rotate around?


That way you won't need any javascript.


Example: if you have a picture with a size of 30x100 and you want to rotate that picture around the coordinate [10,20], then use photoshop or GIMP or so to increase the size of the picture to 40x160 (be careful to extend the canvas to left and up instead of resizing), and using center coordinates it will look as if it rotates around the point you've selected, even if in reality a much larger picture (with a lot of transparent parts) rotates around its center.


The mathematics for resizing depending on your offset and the work in the image program might be tricky, but that way there is no need for javascript, everything will be pure eventing.


Ho !!! haha


I understand your point of view, This is Excellent idea.
I will use it.
However, this will have been more logical to simply define an origin point via a script or in software.
 
Last edited by a moderator:

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,623
Reaction score
1,439
First Language
French
Primarily Uses
RMMV
How about changing the picture in a way that the true center is the point you want to rotate around?
Did you know if we can specifi a rotation by angle.


Like 30 degree ?
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,047
Members
137,569
Latest member
Shtelsky
Top