Status
Not open for further replies.

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,634
Reaction score
1,457
First Language
French
Primarily Uses
RMMV
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
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,718
Reaction score
8,499
First Language
German
Primarily Uses
RMMV
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...
 

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,634
Reaction score
1,457
First Language
French
Primarily Uses
RMMV
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
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,718
Reaction score
8,499
First Language
German
Primarily Uses
RMMV
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.
 

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,634
Reaction score
1,457
First Language
French
Primarily Uses
RMMV
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.
 

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,634
Reaction score
1,457
First Language
French
Primarily Uses
RMMV



Ok it solved!  :guffaw:


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
 
Status
Not open for further replies.

Latest Threads

Latest Profile Posts

Going on hiatus. Won't be back until mid October.:LZSoops:
Just read the English lyrics for Despacito. Ramen aint innocent no more! :kaodes:
Well today was blown away with nothing to show for it. I made a new character to my game who I was going to have a protection mechanic where he protects my main character randomly unless it's a critical, and no matter what, to check if an attack received will be critical, means checking the apply method. This means rewriting the entire method and I refused to do that.
This was originally made for a "castle" challenge, but we just decided to keep it for our actual game :)

1632415929108.png
Would a simple item rarity plugin be useful to someone? Basically, you would set notetag to an item to set its rarity and it would change the text colour of the item.

Forum statistics

Threads
115,313
Messages
1,088,873
Members
149,959
Latest member
bemei2006
Top