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

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 ?
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.
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.
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 ?

Original thread: https://forums.rpgmakerweb.com/threads/origin-_origin-how-to-set-picture-origine.65133/