Rotation for Drawable objects
Created by: Zefk
I think rotation would be nice addition to drawing to the screen.
http://www.solarus-games.org/doc/latest/lua_api_drawable.html#lua_api_drawable_draw EX: drawable:draw(dst_surface, [x, y], [rotate])
rotate = {},
for char = 1,max_dialog_len do
if dl.num1_place[char] == true then
dl.num1_img:draw(screen, dl.place_x[char], dl.place_y[char], rotate[char])
end
end
It may take more calculating depending on whether it is central rotation (like a clock) or where the rotation of the image moves away from the center when rotating.
For non-central rotation I would calculate the change with for loops to get central rotation. As I do below for [x,y], but non-central rotation can be used for other things.
for char = 1,max_dialog_len do
dl.place_y[char] = y_axis
for char = 15,max_dialog_len2 do
dl.place_y[char] = y_axis2
for char = 30,max_dialog_len3 do
dl.place_y[char] = y_axis3
end
end
end
for char = 1,max_dialog_len do
dl.place_x[char] = x_axis
for char = 15,max_dialog_len2 do
dl.place_x[char] = x_axis2
for char = 30,max_dialog_len3 do
dl.place_x[char] = x_axis3
end
end
end
for char = 1,max_dialog_len do
dl.place_x[char] = char * 9 + x_axis
for char = 15,max_dialog_len2 do
dl.place_x[char] = char * 9 + x_axis2
for char = 30,max_dialog_len3 do
dl.place_x[char] = char * 9 + x_axis3
end
end
end
end