Skip to content
Spooner edited this page Jul 22, 2012 · 9 revisions

TODO and completed features

Gosu::Color

  • #to_opengl - Converts to [1.0, 1.0, 1.0, 1.0] rgba format (as used by OpenGL).
  • .from_opengl - Creates new Color object from [1.0, 1.0, 1.0, 1.0] rgba format (as used by OpenGL).
  • #to_i - converts Color object into Gosu integer: 0xAARRGGBB

Gosu::Image

  • #draw - Added :shader hash option to choose optional shader to use.
  • #draw_rot - Added :shader hash option to choose optional shader to use.
  • #draw_as_points - Draw many sprites, with different x,y but otherwise identical.
  • [TODO] #flip!, #flip, #mirror!, #mirror, #scale!, #scale, etc.
  • [TODO] #resize (Well, create another image which is smaller/larger).
  • [TODO] #to_framebuffer

Gosu::Window

  • .back_buffer - Window-sized framebuffer for general use.
  • #post_process {} - Apply a shader (or shaders) to the contents of the block, after they have been drawn.
  • [TODO] #to_framebuffer - Copy the contents of the window as a {Ashton::Framebuffer}.
  • [TODO] #to_image - Create Gosu::Image from window contents.
  • [TODO] #draw_line - Added :shader hash option
  • [TODO] #draw_quad - Added :shader hash option
  • [TODO] #draw_triangle - Added :shader hash option

Ashton::Shader

  • Wrapper around a GLSL shader program, which allows for complex, real-time, graphical manipulations.
  • #use {} - Inside the block, all draw operations are affected by the shader (Generally best to use Window#post_process or Image.draw* for this).
  • Supports vertex and fragment shaders. Geometry shaders would require OpenGL at a higher level.
  • Includes a small library of example shaders, which can be used to both affect individual draw actions or post-process the whole screen (:radial_blur, :pixelate, etc).

Ashton::Lighting::LightSource

  • A source of illumination with radius and color. Generally easiest to use as part of a Lighting::Manager

Ashton::Lighting::Manager

  • Manages one or more LightSource objects and merges them to create a screen-sized lighting effect.
  • #create_light Creates a new light-source.

Ashton::Framebuffer

  • A relatively low-level graphics buffer that can be drawn onto and drawn onto the Window.
  • #use {} - Inside the block, draw operations go into the framebuffer, rather than onto the window.
  • #to_image - Convert to Gosu::Image.
  • #draw - Draw directly onto a Gosu::Window (Only accepts x, y coordinate).
  • #clear
  • #[x, y] - Get Gosu::Color of a specific pixel.
  • #transparent?(x, y) - true if the pixel at that point has alpha == 0 (useful for pixel-based collision). VERY FAST!
  • [TODO] #flip!, #flip - Invert framebuffer's vertical orientation.
  • [TODO] Support for stencils.
  • [TODO] Support RGB, RGBA, etc. (only RGBA currently).

Ashton::ParticleEmitter

  • Generates and managed particles with acceleration, gravity, velocity, angular velocity, direction, image, color, etc.
  • Particle velocity affected by acceleration and gravity, fade (affects alpha) and zoom (affects scale).
  • [TODO] Changes rgb color over time.