This has been dropped in favour of neospec
{Camera2D#initialize} now takes in keyword arguments and provides sane defaults. So if you have a {Camera2D} initialized like this.
camera = Camera2D.new(Vector2.new(x: 0, y: 0), Vector2.new(x: 0, y: 0), 0, 1)You can now just do this.
camera = Camera2D.newBut if you need to specify just one of the arguments, you can now easily do so like this.
camera = Camera2D.new(target: Vector2[400, 240])Camera2D#drawing has now been renamed {Camera2D#draw}, so this.
camera = Camera2D.new(Vector2.new(x: 0, y: 0), Vector2.new(x: 0, y: 0), 0, 1)
camera.drawing {
Rectangle.new(10, 10, 50, 50).draw(colour: RED)
}Is now this.
camera = Camera2D.new
camera.draw {
Rectangle.new(10, 10, 50, 50).draw(colour: RED)
}You now need to specify keyword arguments. So instead of calling:
colour = Colour.new(128, 128, 0, 255)You should now call:
colour = Colour.new(red: 128, blue: 128, green: 0, alpha: 255)Or you could call it this way:
colour = Colour[128, 128, 0]All the {Colour} constants have been namespaced. So instead of these
LIGHTGRAY
GRAY
DARKGRAY
YELLOW
GOLD
ORANGE
PINK
RED
MAROON
GREEN
LIME
DARKGREEN
SKYBLUE
BLUE
DARKBLUE
PURPLE
VIOLET
DARKPURPLE
BEIGE
BROWN
DARKBROWN
WHITE
BLACK
BLANK
MAGENTA
RAYWHITEYou should now call these
Colour::LIGHTGRAY
Colour::GRAY
Colour::DARKGRAY
Colour::YELLOW
Colour::GOLD
Colour::ORANGE
Colour::PINK
Colour::RED
Colour::MAROON
Colour::GREEN
Colour::LIME
Colour::DARKGREEN
Colour::SKYBLUE
Colour::BLUE
Colour::DARKBLUE
Colour::PURPLE
Colour::VIOLET
Colour::DARKPURPLE
Colour::BEIGE
Colour::BROWN
Colour::DARKBROWN
Colour::WHITE
Colour::BLACK
Colour::BLANK
Colour::MAGENTA
Colour::RAYWHITEThis has been replaced by {Image#initialize}.
Instead of calling:
image = Image.load("./assets/image.png")you should instead call:
image = Image.new("./assets/image.png")The default colour is now {Colour::BLANK}.
instead of calling:
image = Image.generate(width: 16, height: 8)you should instead call:
image = Image.generate(width: 16, height: 8, colour: Colour::RAYWHITE)The keyword argument scaling has now become scaler. The error message has
also been changed but is still an ArgumentError.
Instead of calling:
image = Image.load("./assets/image.png")
image.resize!(width: 1920, height: 1080, scaling: :bicubic)you should instead call:
image = Image.new("./assets/image.png")
image.resize!(width: 1920, height: 1080, scaler: :bicubic)This has been changed to take a keyword argument instead.
Instead of calling:
image = Image.load("./assets/spritesheet.png")
image.resize!(Rectangle.new(0, 0, 8, 8))you should instead call:
image = Image.new("./assets/spritesheet.png")
image.resize!(source: Rectangle[0, 0, 8, 8])This has been replaced by {Image#alpha_mask!}.
Instead of calling:
image = Image.load("./assets/sprite.png")
mask = Image.load("./assets/sprite_mask.png")
image.alpha_mask = maskyou should instead call:
image = Image.new("./assets/sprite.png")
mask = Image.new("./assets/sprite_mask.png")
image.alpha_mask!(mask)This has been replaced by {Image#flip_vertically!}.
Instead of calling:
image = Image.load("./assets/sprite.png")
image.flip_vertical!you should instead call:
image = Image.new("./assets/sprite.png")
image.flip_vertically!This has been replaced by {Image#flip_horizontally!}.
Instead of calling:
image = Image.load("./assets/sprite.png")
image.flip_horizontal!you should instead call:
image = Image.new("./assets/sprite.png")
image.flip_horizontally!This has been replaced by {Image#rotate_clockwise!} and {Image#rotate_counter_clockwise!}.
Instead of calling:
sprite = Image.load("./assets/sprite.png")
copy = sprite.copy
sprite.rotate!(:cw)
copy.rotate!(:ccw)you should instead call:
sprite = Image.new("./assets/sprite.png")
copy = sprite.copy
sprite.rotate_clockwise!
copy.rotate_counter_clockwise!This now takes a keyword argument of colour.
Instead of calling:
sprite = Image.load("./assets/sprite.png")
sprite.tint!(GREEN)you should instead call:
sprite = Image.new("./assets/sprite.png")
sprite.tint!(colour: GREEN)This has been renamed to {Image#greyscale!}.
Instead of calling:
sprite = Image.load("./assets/sprite.png")
sprite.grayscale!you should instead call:
sprite = Image.new("./assets/sprite.png")
sprite.greyscale!This method now takes keyword arguments.
Instead of calling:
sprite = Image.load("./assets/sprite.png")
sprite.replace!(GREEN, BLUE)you should instead call:
sprite = Image.new("./assets/sprite.png")
sprite.replace!(from: Colour::GREEN, to: Colour::BLUE)This has been removed in favour of {Shader.valid?}
This has been removed in favour of {Shader.location_of}
This has been removed in favour of {Shader.set}
This has been removed in favour of {Shader.set}
{Vector2#initialize} uses keyword arguments.
Instead of calling:
position = Vector2.new(2, 4)you should instead call:
position = Vector2.new(x: 2, y: 4)This has been replaced by {Font#initialize}.
Instead of calling:
font = Font.load("./assets/my_font.ttf", size: 16)you should instead call:
font = Font.new("./assets/my_font.ttf", size: 16)This has been replaced by {Font#valid?}.
This has been renamed to size.
font = Font.new("./assets/my_font.ttf", size: 16)
puts font.size
# => 16The base_size key has been renamed to size.
font = Font.new("./assets/my_font.ttf", size: 16)
p font.to_h
# => {
# :size=>16,
# :glyph_count=>95,
# :glyph_padding=>4,
# :texture=>{
# :id=>3.0,
# :width=>512.0,
# :height=>512.0,
# :mipmaps=>1.0,
# :format=>2.0
# }
# }When drawing a font to the screen, you now no longer need to specify a {Vector2}
yourself, you can just pass x and y like this.
font.draw("hello", x: 16, y: 42)But passing position is still supported, so this still works.
font.draw("hello", position: Vector2.new(x: 16, y: 42))The padding argument is now spacing to be more consistent and more
accurately represent what it does.
font.to_image("hello", padding: 3)becomes:
font.to_image("hello", spacing: 3)Previously to draw text using the default font draw_text would've been used.
draw_text("hello", 16, 42, 16)This behavior has been removed and now Font#default is used to access the default font.
Font.default.draw("hello", x: 16, y: 42, size: 16)This has been replaced by {Music#initialize}.
Instead of calling:
font = Music.load("./assets/music.ogg")you should instead call:
font = Music.new("./assets/music.ogg")This has been removed as I don't see a need to update the underlying C struct information.
This has been removed as I don't see a need to update the underlying C struct information.
{Rectangle#initialize} now takes in keyword arguments and has the variables required to draw it. So if you have a {Rectangle} initialized like this.
rectangle = Rectangle.new(0, 0, 16, 16)You can now just do this.
rectangle = Rectangle.new(x: 0, y: 0, width: 16, height: 16, Colour::RED){Rectangle#draw} doesn't take any arguments as the {Rectangle} contains all the information it needs.
This has been replaced by {Sound#initialize}.
Instead of calling:
font = Sound.load("./assets/music.wav")you should instead call:
font = Sound.new("./assets/music.wav")This has been removed as I don't see a need to update the underlying C struct information.
This has been replaced by {Texture2D#initialize}.
Instead of calling:
texture = Texture2D.load("./assets/image.png")you should instead call:
texture = Texture2D.new("./assets/image.png")This has been deprecated.
This has been deprecated.
This has been deprecated.
This has been deprecated.
This has been deprecated.
The origin argument now defaults to the centre of the destination.
This now takes keyword arguments.
Instead of calling:
texture = RenderTexture.new(100, 100)you should instead call:
texture = RenderTexture.new(width: 100, height: 100)Now no longer returns information about the {Texture2D}.
This has been removed in favour of {RenderTexture#draw}
This has been removed in favour of {Font#initialize}.
This has been removed in favour of {Font#unload}.
This has been removed in favour of {Font#draw}.
This has been removed in favour of {Font#draw}.
This has been removed in favour of {Font#measure}.
This has been removed in favour of {Font#to_image}.
This has been removed in favour of {Camera2D#draw}.
This has been removed in favour of {Camera2D#draw}.
This has been removed in favour of {Camera2D#as_in_viewport}
This has been removed in favour of {Camera2D#as_in_world}
This has been removed in favour of {Image#initialize}
This has been removed in favour of {Image#unload}
This has been removed in favour of {Image#export}
This has been removed in favour of {Image#copy}
This has been removed in favour of {Image#copy} with source specified
This has been removed in favour of {Font#to_image}
This has been removed in favour of {Image.generate}
This has been removed in favour of {Image#resize!}
This has been removed in favour of {Image#resize!}
This has been removed in favour of {Image#crop!}
This has been removed in favour of {Image#flip_vertically!}
This has been removed in favour of {Image#flip_horizontally!}
This has been removed in favour of {Image#rotate_clockwise!}
This has been removed in favour of {Image#rotate_counter_clockwise!}
This has been removed in favour of {Image#to_texture}
This has been removed in favour of {Image#premultiply_alpha!}
This has been removed in favour of {Image#generate_mipmaps!}
This has been removed in favour of {Image#tint!}
This has been removed in favour of {Image#invert!}
This has been removed in favour of {Image#greyscale!}
This has been removed in favour of {Image#contrast!}
This has been removed in favour of {Image#brightness!}
This has been removed in favour of {Image#replace!}
This has been removed in favour of {Image#draw!}
This has been removed in favour of {Audio.open}
This has been removed in favour of {Audio.close}
This has been removed in favour of {Audio.ready?}
This has been removed in favour of {Audio.volume=} and now takes a volume between 0 and 100.
Instead of calling:
init_audio_device
set_master_volume(0.7)
close_audio_deviceYou should instead call:
Audio.open
Audio.volume = 70
Audio.closeThis has been removed in favour of {Music#initialize}.
This has been removed in favour of {Music#unload}.
This has been removed in favour of {Music#play}.
This has been removed in favour of {Music#playing?}.
This has been removed in favour of {Music#stop}.
This has been removed in favour of {Music#played}.
This has been removed in favour of {Music#update}.
This has been removed in favour of {Music#pause}.
This has been removed in favour of {Music#resume}.
This has been removed in favour of {Music#length}.
This has been removed in favour of {Music#volume=}.
This has been removed in favour of {Music#pitch=}.
This has been removed in favour of {Sound#initialize}.
This has been removed in favour of {Sound#unload}.
This has been removed in favour of {Sound#play}.
This has been removed in favour of {Sound#stop}.
This has been removed in favour of {Sound#pause}.
This has been removed in favour of {Sound#resume}.
This has been removed in favour of {Sound#playing?}.
This has been removed in favour of {Sound#volume=}.
This has been removed in favour of {Sound#pitch=}.
This has been removed in favour of {Cursor.show}.
This has been removed in favour of {Cursor.hide}.
#cursor_hidden?
This has been removed in favour of {Cursor.hidden?}.
This has been removed in favour of {Cursor.enable}.
This has been removed in favour of {Cursor.disable}.
This has been removed in favour of {Cursor.on_screen?}.
This has been removed in favour of {Mouse.pressed?}.
This has been removed in favour of {Mouse.down?}.
This has been removed in favour of {Mouse.released?}.
This has been removed in favour of {Mouse.up?}.
This has been removed in favour of {Mouse.position}.x.
This has been removed in favour of {Mouse.position}.y.
This has been removed in favour of {Mouse.position}.
This has been removed in favour of {Mouse.position=}.
This has been removed in favour of {Mouse.offset=}.
This has been removed in favour of {Mouse.scale=}.
This has been removed in favour of {Mouse.wheel_moved}, you will need to use
Mouse.wheel_moved.y.
This has been removed in favour of {Cursor.icon=}.
This has been removed in favour of {Key.pressed?}.
This has been removed in favour of {Key.released?}.
This has been removed in favour of {Key.down?}.
This has been removed in favour of {Key.up?}.
This has been removed in favour of {Key.pressed}.
This has been removed in favour of {Key.pressed_character}. If you still need this as
an integer you can call Key.pressed_character.bytes.first.
This has been removed in favour of {Window.open}.
This has been removed in favour of {Window.width}.
This has been removed in favour of {Window.height}.
This has been removed in favour of {Window.close?}.
This has been removed in favour of {Window.close}.
This has been removed in favour of {Window.ready?}.
This has been removed in favour of {Window.flag?}
This has been removed in favour of {Window.flags=}
This has been removed in favour of {Window.config=}
This has been removed in favour of {Window.fullscreen?}
This has been removed in favour of {Window.minimised?}
This has been removed in favour of {Window.maximised?}
This has been removed in favour of {Window.focused?}
#window_hidden?
This has been removed in favour of {Window.hidden?}
This has been removed in favour of {Window.clear_flag}
This has been removed in favour of {Window.exit_key=}
This has been removed in favour of {Window.resized?}
This has been removed in favour of {Window.toggle_fullscreen}
This has been removed in favour of {Window.maximise}
This has been removed in favour of {Window.minimise}
This has been removed in favour of {Window.restore}
This has been removed in favour of {Window.icon=}
This has been removed in favour of {Window.title=}
This has been removed in favour of {Window.position}
This has been removed in favour of {Window.position=}, it also now takes a
{Vector2} instead of x and y as integers.
set_window_position(x, y)Now becomes
Window.position = Vector2[x, y]Although it's probably better to refactor your code to persist a {Vector2}
instead of x and y as variables
This has been removed in favour of {Window.minimum_resolution=}, it also now takes a
{Vector2} instead of x and y as integers.
set_window_min_size(x, y)Now becomes
Window.minimum_resolution = Vector2[x, y]Although it's probably better to refactor your code to persist a {Vector2}
instead of x and y as variables
This has been removed in favour of {Window.resolution=}, it also now takes a
{Vector2} instead of width and height as integers.
set_window_min_size(width, height)Now becomes
Window.minimum_resolution = Vector2[width, height]Although it's probably better to refactor your code to persist a {Vector2}
instead of width and height as variables
This has been removed in favour of {Window.to_image}
This has been removed in favour of {Taylor::Platform.android?}
This has been removed in favour of {Taylor::Platform.browser?}
This has been removed in favour of {Taylor::Platform.linux?}
This has been removed in favour of {Taylor::Platform.osx?}
This has been removed in favour of {Taylor::Platform.windows?}
This has been removed in favour of {Taylor.released?}
This has been removed in favour of {Touch.position_for}
This has been removed in favour of {Texture2D.initialize}
This has been removed in favour of {Texture2D#unload}
This has been removed in favour of {Texture2D::NO_FILTER}
This has been removed in favour of {Texture2D::BILINEAR}
This has been removed in favour of {Texture2D::TRILINEAR}
This has been removed in favour of {Texture2D::ANISOTROPIC_4X}
This has been removed in favour of {Texture2D::ANISOTROPIC_8X}
This has been removed in favour of {Texture2D::ANISOTROPIC_16X}
This has been removed in favour of {Texture2D#filter=}
This has been removed in favour of {Texture2D#generate_mipmaps}
This has been removed in favour of {Colour#fade}
This has been removed in favour of {Texture2D#draw}
This has been removed in favour of {Texture2D#draw}
This has been removed in favour of {Monitor.count}
This has been removed in favour of {Monitor.current}
This has been removed in favour of {Monitor#position}
This has been removed in favour of {Monitor#width}
This has been removed in favour of {Monitor#height}
This has been removed in favour of {Monitor#refresh_rate}
This has been removed in favour of {Circle#draw}
This has been removed in favour of {Circle#draw}
This has been deprecated completely
This has been deprecated completely
This has been removed in favour of {Circle#draw}
This has been removed in favour of {Circle#draw}
This has been removed in favour of {Line#draw}
This has been removed in favour of {Line#draw}
This has been removed in favour of {Line#draw}
This has been deprecated completely
This has been deprecated completely
This has been deprecated completely
This has been removed in favour of {Vector2#draw}
This has been removed in favour of {Vector2#draw}
This has been removed in favour of {Rectangle#draw}
This has been removed in favour of {Rectangle#draw}
This has been deprecated completely
This has been deprecated completely
This has been deprecated completely
This has been deprecated completely
This has been removed in favour of {Rectangle#draw}
This has been deprecated completely
This has been removed in favour of {Rectangle#draw}
This has been removed in favour of {Rectangle#draw}
This has been deprecated completely
This has been removed in favour of {Window#monitor=}
This has been removed in favour of {Window#scale}
This has been removed in favour of {Gamepad#available?}
This has been removed in favour of {Gamepad#name}
This has been removed in favour of {Gamepad#pressed?}
This has been removed in favour of {Gamepad#released?}
This has been removed in favour of {Gamepad#down?}
This has been removed in favour of {Gamepad#up?}
This has been deprecated completely
This has been removed in favour of {Gamepad#axis_count}
This has been removed in favour of {Gamepad#axis}
This has been removed in favour of {Gamepad.add_mappings}
This has been removed in favour of {Gesture.enabled=}
This has been removed in favour of {Gesture.detected}
This has been removed in favour of {DroppedFiles.any?}
This has been removed in favour of {DroppedFiles.all}
This has been removed in favour of {Shader#initialize}
This has been removed in favour of {Shader#unload}
This has been removed in favour of {Shader#valid?}
This has been removed in favour of {Shader.load_code}
This has been removed in favour of {Shader.location_of}
This has been removed in favour of {Shader.set}
This has been removed in favour of {Window.draw} or {Window.begin_drawing}
This has been removed in favour of {Window.draw} or {Window.end_drawing}
This has been removed in favour of {Window.draw}
This has been removed in favour of {Window.clear}
This has been removed in favour of {Window.clear}
The default {Colour} has switched from {Colour::RAYWHITE} to {Colour::BLACK}
This has been removed in favour of {Rectangle#begin_scissoring}
This has been removed in favour of {Rectangle#end_scissoring}
This has been removed in favour of {Rectangle#scissor}
This has been removed in favour of {RenderTexture#begin_drawing} or {RenderTexture#draw}
This has been removed in favour of {RenderTexture#end_drawing} or {RenderTexture#draw}
This has been removed in favour of {Shader#begin_drawing} or {Shader#draw}
This has been removed in favour of {Shader#end_drawing} or {Shader#draw}
This has been removed in favour of {Window.screenshot}
This has been removed in favour of {Window.target_frame_rate=}
This has been removed in favour of {Window.frame_rate}
This has been removed in favour of {Window.frame_time}
This has been removed in favour of {Window.seconds_open}
This has been removed in favour of {Window.draw_frame_rate}
This has been removed in favour of {Logging.level=}
This has been removed in favour of {Browser.open}
This has been removed in favour of {Clipboard.text=}
This has been removed in favour of {Clipboard.text}
This has been removed in favour of {Browser.main_loop=}
This has been removed in favour of {Browser.cancel_main_loop}
This has been removed in favour of {Browser.attribute_from_element}
This has been removed in favour of {Window.begin_blending} or {Window.blend}
This has been removed in favour of {Window.end_blending} or {Window.blend}