font.register_entity('smile', smile_image) might draw a smiley face (one assumes) wherever it sees ⌣ in your string.
class Window < Gosu::Window
def initialize
super 320, 240, false
@x, @y = 0.0, 0.0
@theta = 0.0
@vx, @vy = 0.0, 0.0
@omega = 0.0
end
def button_down id
case id
when Gosu::KbLeft then @vx -= 1
when Gosu::KbRight then @vx += 1
when Gosu::KbUp then @vy -= 1
when Gosu::KbDown then @vy += 1
when Gosu::KbPageUp then @omega -= 1
when Gosu::KbPageDown then @omega += 1
end
end
def button_up id
case id
when Gosu::KbLeft then @vx += 1
when Gosu::KbRight then @vx -= 1
when Gosu::KbUp then @vy += 1
when Gosu::KbDown then @vy -= 1
when Gosu::KbPageUp then @omega += 1
when Gosu::KbPageDown then @omega -= 1
end
end
def update
@x += @vx
@y += @vy
@theta += @omega
end
def draw
translate @x, @y do
rotate @theta do
draw_quad \
-8, -8, Gosu::Color::WHITE,
+8, -8, Gosu::Color::WHITE,
+8, +8, Gosu::Color::WHITE,
-8, +8, Gosu::Color::WHITE, 0
end # rotate
end # translate
end
endglPushMatrix();
glTranslate(x, y);
glPushMatrix();
glRotate(theta);
/* draw code here */
glPopMatrix();
glPopMatrix();Powered by mwForum 2.29.0 © 1999-2013 Markus Wichitill