How set a value in $gameScreen._pictures[] [solved]

Hi guys.
I did succeed to set value to a array X,Y value.


I try to set definitely the ._originX of the ex: $gameScreen._pictures[1]


I try this 


 $gameScreen._pictures[1]._originX=800;


or 


 $gameScreen._pictures[1]._originX.setValue(800);


Nothing work


Its Alway reset to default ??


Ex: here, i need to definitely change the value 


_originX:400
_originY:400


To another valur


 there is a particular syntax?

Code:
Game_Picture {_name: "suny-2", _origin: 0, _x: 340, _y: -80.00000048000004, _scaleX: 100…}
_angle: 0
_bindToMap: 1
_blendMode: 0
_duration: 0
_height: 375
_horSpacing: 2400_layer: "above_characters"
_loopHeight: 4800
_loopWidth: 4800
_mapOffsX: 0
_mapOffsY: 0
_name: "suny-2"
_opacity: 255
_origin: 0
_originX: 400
_originY: 400
_rotationSpeed: 0
_scaleX: 100
_scaleY: 100
_targetOpacity: 255
_targetScaleX: 100
_targetScaleY: 100
_targetX: 400
_targetY: 400
_tone: null_toneDuration: 0
_toneTarget: null
_useHorizontalRepeat: true
_useVerticalRepeat: true
_verSpacing: 2400
_width: 403
_x: 340
_y: -80.00000048000004dTextInfo: nulldTextValue: null
__proto__: Game_Picture
Perhaps you should explain why exactly you want to do that?


I could understand if you want to change _x and _y to move the picture, or scaling to resize it, but why change the origin? that doesn't make any sense to me...
Perhaps you should explain why exactly you want to do that?


I could understand if you want to change _x and _y to move the picture, or scaling to resize it, but why change the origin? that doesn't make any sense to me...



Its hard to me to explain.


In basic, i have planet rotate.
When click galaxi
This move and zoom, but need to bind planet befor move and zoom.
When i try bindpictures( all planet)


They bind to original 


_originX: 400
_originY
: 400


So i need to set 



EX: 


CurrentX = $gameScreen._pictures[1]._x // Exampel this give 800


$gameScreen._pictures[1]._originX = (CurrentX);


And after i use 
this.bindPictureToMap(1, 1, 'above_characters');


But after i bind my picture, the  ._originX and ._originY Reset default value (400)!!!!


I made little video to show you what am trying to do.
If you have some other idea is welcome 🙂


When i clic, i need save all ._X and ._Y, and inject in all ._originX   ._originY Permanently
yes, I understand what you want to do. Unfortunately that is not something as easy as a changing of the origin suggests.


Sorry - I'm too exhausted at the moment to really think it through, but I think you'll need three coordinate systems with three origins to pull this off, precisely because the computer needs an unchanging origin to keep everything fixed. There might be a way around that with some fancy mathematical transformation, but I can't even point you in the correct direction at the moment.
yes, I understand what you want to do. Unfortunately that is not something as easy as a changing of the origin suggests.


Sorry - I'm too exhausted at the moment to really think it through, but I think you'll need three coordinate systems with three origins to pull this off, precisely because the computer needs an unchanging origin to keep everything fixed. There might be a way around that with some fancy mathematical transformation, but I can't even point you in the correct direction at the moment.

ok ok thanks anyway friend



I'll see if I can find another direction and approach, but I spending more than 3 hours to reflect and am locked.



Ok it solved!  🤣


I used the wrong function as a beginner


$gameScreen._pictures[Planet5PID]._originX = ...


instead of this


the good way !


$gameScreen.picture(Planet5PID)._originX = ....


So this is awesome, because, you can easy move a bind picture in a parallel process !!!


this.bindPictureToMap(Planet5PID, 1, 'above_characters'); // Bind to wrong pos
var TMp1x = ($dataMap.events[3].x*48) + Math.cos(g3p1angle) * (g3p1radius*2.5); // galaxi, planet, posX // calculate true moved posx
var TMp1y = ($dataMap.events[3].y*48) + Math.sin(g3p1angle) * g3p1radius; // galaxi, planet, posY // calculate true moved posy
// Inject the true last moved pos X,Y in the ._originX
$gameScreen.picture(Planet5PID)._originX = TMp1x; // move the bind to good X pos
$gameScreen.picture(Planet5PID)._originY = TMp1y; // move the bind to good y pos


so it's good to know, to move a binded picture, simply increments the variable in
._originX, ._originY


with 


$gameScreen.picture( )._originX


Tanks all for help

Original thread: https://forums.rpgmakerweb.com/threads/how-set-a-value-in-gamescreen-_pictures-solved.68111/