# Encoding: UTF-8
=begin
Ce fichier rb ne sert qu'à tester des truc.
=end
# Appeler Gosu.
require 'gosu'
# Créer une fenêtre principale.
class GameWindow < Gosu::Window # On crée une classe fille
def initialize
@max_width=512
@max_height=300
super(@max_width, @max_height, false, 1000/75) # False : pas en plein écran. 1000/75 = 75 FPS. Par défaut : 60.
self.caption = "Français" # Titre de la fenêtre.
# On charge des images pour les utiliser plus tard.
@mouse_pointer = Gosu::Image.new(self, "pictures/Circle_Curseur_fini2.png", true)
@background_image = Gosu::Image.new(self, "pictures/EEE_PC_01_-_Kara_no_Kyoukai.png", false)
@music = Gosu::Song.new(self, "sounds/Devils_Never_Cry.ogg")
@se = Gosu::Sample.new(self, "sounds/flash2.ogg")
end
def button_down(id)
close if id == Gosu::Button::KbEscape
@music.play if button_down? char_to_button_id("m")
@se.play if button_down? char_to_button_id("s")
end
# Ici, on gère tout ce qui ce "renouvelle".
def update
# du code
end
# Par contre, là, on gère l'affichage à proprement parler des images.'
def draw
@background_image.draw_as_quad(0,0,Gosu::Color::WHITE,@max_width,0,Gosu::Color::WHITE\
,0,@max_height,Gosu::Color::WHITE,@max_width,@max_height,Gosu::Color::WHITE,0)
@mouse_pointer.draw(mouse_x - @mouse_pointer.width, mouse_y - @mouse_pointer.height, 250)
end
end
# Création de la fenêtre.
window = GameWindow.new
# Affichage de la fenêtre.
window.show
x="français"
GLUT.CreateWindow(x.unpack('C*').pack('U*'))
Gosu::Image::load_tiles
gives me headaches. If alone, everythings ok, but with other images it doesn't work at all.Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill