Status
Not open for further replies.

Mycael

Warper
Member
Joined
Dec 29, 2015
Messages
4
Reaction score
0
First Language
English
Hi all,


I have a problem with an animation I'm working on for my mv project.


I use this code:


this.rotation =  angle * Math.PI / 180;


But my image rotates following the top left corner.


I need my image to rotate at it's center.


My image is a bitmap


I need something like


this.translate( canvasRotationCenterX, canvasRotationCenterY );


Does rpgmaker have something similar to this?


Can anyone point me to the right direction?


Thank you.


All the best,


Mycael
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,867
Reaction score
14,521
First Language
English
Primarily Uses
RMMV
What is 'this'?  A Sprite?  a Sprite_Base?


this.anchor.x = 0.5;


this.anchor.y = 0.5;


will set the anchor/origin to the center of the image.


Please don't post the same question multiple times in different places.  The mods will move it if it's in the wrong forum (or you can report it and ask it to be moved).
 
Last edited by a moderator:

Mycael

Warper
Member
Joined
Dec 29, 2015
Messages
4
Reaction score
0
First Language
English
Hi,


Thank you for the reply.


Sorry for double posting. I thought my first post wasn't sent.


About my image.


My bitmap object is associated with windows.


So, I use 


this.contents.blt(bitmap, 0, 0, pw, ph, 0, 0); 


to run my image.


I can't seem to use anchor.x and anchor.y


anchor is undefined. Thanks
 

RyanYe

RPG Game Lover
Veteran
Joined
Dec 31, 2020
Messages
77
Reaction score
12
First Language
English
Primarily Uses
RMMV
What is 'this'? A Sprite? a Sprite_Base?


this.anchor.x = 0.5;


this.anchor.y = 0.5;


will set the anchor/origin to the center of the image.


Please don't post the same question multiple times in different places. The mods will move it if it's in the wrong forum (or you can report it and ask it to be moved).
i got the very same problem , i don't want to send a duplicate post since this one already reply-able

i don't know how to set anchor.x, can you tell me? i want to write this in a plugin js file

thank Shaz!
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,867
Reaction score
14,521
First Language
English
Primarily Uses
RMMV

@RyanYe, please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.



Our necroposting rules apply whether the thread has been closed or not. The OP already had an idea where the code needed to go, even in their response. And you have not indicated what sort of images you are trying to rotate either, so we can't tell you anything more than what's already above.

Please start your own new thread and provide enough detail about what you're trying to do so we're not just guessing at possible solutions.
 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts

I've decided "Attack on Equestria" should be released first... hence this new ARG channel! https://www.youtube.com/channel/UClKiUI8xOVx9dsF4kRXUmxw
Check it out, and subscribe! The ARG will lead up to the video game. It's not a creepy game, but I just thought it should follow ARG standards.
For anyone interested in my project M - i finally made a gamethread about it :D

Yay. I turned 39 today. Another year older, another year closer to the grave.
I'm sure the latest post/thread in the sidebar used to have 5 posts. Was it always been like this?

Made it to the 10th video doing this! :kaocry:

renderTimingPixel.png

Forum statistics

Threads
110,407
Messages
1,053,064
Members
143,469
Latest member
ClementPanchout
Top