Class: GamesParadise::HelloWorld
- Inherits:
-
Gosu::Window
- Object
- Gosu::Window
- GamesParadise::HelloWorld
- Includes:
- Colours
- Defined in:
- lib/games_paradise/hello_world/gosu/hello_world.rb
Overview
GamesParadise::HelloWorld
Constant Summary collapse
- WIDTH =
#
WIDTH
#
800
- HEIGHT =
#
HEIGHT
#
600
- TITLE =
#
TITLE
#
'Hello World!'
Class Method Summary collapse
-
.[](i = '') ⇒ Object
# === GamesParadise::HelloWorld[] ========================================================================= #.
Instance Method Summary collapse
-
#commandline_arguments? ⇒ Boolean
# === commandline_arguments? ========================================================================= #.
-
#draw ⇒ Object
# === draw ========================================================================= #.
-
#first_argument? ⇒ Boolean
(also: #first?)
# === first_argument? ========================================================================= #.
-
#initialize(commandline_arguments = nil, run_already = true) ⇒ HelloWorld
constructor
# === initialize ========================================================================= #.
-
#reset ⇒ Object
# === reset (reset tag) ========================================================================= #.
-
#run ⇒ Object
# === run (run tag) ========================================================================= #.
-
#set_commandline_arguments(i = '') ⇒ Object
# === set_commandline_arguments ========================================================================= #.
-
#update ⇒ Object
# === update ========================================================================= #.
Methods included from Colours
#brown, #cfile, #convert_colour, #fancy, #normal, #pink, #red, #yel
Methods inherited from Gosu::Window
#gosu_button_down?, #image, #image10?, #image1?, #image2?, #image3?, #image4?, #image5?, #image6?, #image7?, #image8?, #image9?, #on_left_arrow_pressed?, #on_right_arrow_pressed?, #q_means_quit, #set_font, #set_title, #sqrt, #tab_key?, #write_this_text
Constructor Details
#initialize(commandline_arguments = nil, run_already = true) ⇒ HelloWorld
#
initialize
#
43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/games_paradise/hello_world/gosu/hello_world.rb', line 43 def initialize( commandline_arguments = nil, run_already = true ) super(WIDTH, HEIGHT) set_title(TITLE) reset set_commandline_arguments( commandline_arguments ) run if run_already end |
Class Method Details
.[](i = '') ⇒ Object
#
GamesParadise::HelloWorld[]
#
111 112 113 |
# File 'lib/games_paradise/hello_world/gosu/hello_world.rb', line 111 def self.[](i = '') new(i) end |
Instance Method Details
#commandline_arguments? ⇒ Boolean
#
commandline_arguments?
#
77 78 79 |
# File 'lib/games_paradise/hello_world/gosu/hello_world.rb', line 77 def commandline_arguments? @commandline_arguments end |
#draw ⇒ Object
#
draw
#
91 92 93 |
# File 'lib/games_paradise/hello_world/gosu/hello_world.rb', line 91 def draw @font.red('Hello world!', 50, 10, 0, 1, 1) end |
#first_argument? ⇒ Boolean Also known as: first?
#
first_argument?
#
84 85 86 |
# File 'lib/games_paradise/hello_world/gosu/hello_world.rb', line 84 def first_argument? @commandline_arguments.first end |
#reset ⇒ Object
#
reset (reset tag)
#
59 60 61 62 63 64 |
# File 'lib/games_paradise/hello_world/gosu/hello_world.rb', line 59 def reset # ======================================================================= # # === @font # ======================================================================= # @font = set_font(:hack_25) end |
#run ⇒ Object
#
run (run tag)
#
105 106 |
# File 'lib/games_paradise/hello_world/gosu/hello_world.rb', line 105 def run end |
#set_commandline_arguments(i = '') ⇒ Object
#
set_commandline_arguments
#
69 70 71 72 |
# File 'lib/games_paradise/hello_world/gosu/hello_world.rb', line 69 def set_commandline_arguments(i = '') i = [i].flatten.compact @commandline_arguments = i end |
#update ⇒ Object
#
update
#
98 99 100 |
# File 'lib/games_paradise/hello_world/gosu/hello_world.rb', line 98 def update exit_on_q end |