[ACE] SETTING PICTURE ANGLE DIRECTLY
Posts
Pages:
1
How can I set specific picture's angle directly? I'm making "flashlight" which uses picture to mask rest of the scene off, but don't want to make 4 separate pictures for each direction. So I need a way to set specific angle to the picture.
To be honest, four separate images would be best due to the way torches illuminate the area from different directions. An example:
Of course, you could go the 'circle of light' route instead.
Of course, you could go the 'circle of light' route instead.
In RMXP, you can open the script editor, find the Game_Picture entry, and add this method somewhere inside it:
then you can call this script from any event:
(replace "picture" with the id of the picture, and value with the desired angle)
not sure about vx and vx ace... but I'll look into it.
UPDATE:
In vx ace its just slightly different: (only the calling script changes, you still need to add the "set_ang" method inside Game_Picture)
def set_ang(angle)
@angle = angle
end
(replace "picture" with the id of the picture, and value with the desired angle)
$game_screen.pictures[picture].set_ang(value)
UPDATE:
In vx ace its just slightly different: (only the calling script changes, you still need to add the "set_ang" method inside Game_Picture)
$game_map.screen.pictures[picture].set_ang(value)
Thanks. You pointed me in the right direction, though I did it bit differently. Instead of adding method, I've changed line 22 of the script so it reads
instead of
Then:
attr_accessor :angle
instead of
attr_reader :angle
Then:
$game_map.screen.pictures[picture].angle = value
Yeah that's perfect too. I work in Java lately, and I got a new habit of never making class variables public :D...
Eh, getters/setters are biggest cause of WTFs. When working in Java, I can live with standard library's habit of using getters/setters, but all my classes don't use those.
Pages:
1