Skip to content

class Commands

#rect(x, y, width, height) public

Draw a rectangle. Yields a Commands::Rectangle

Arguments

  • x - the x coordinate
  • y - the y coordinate
  • width - the width of the rectangle
  • height - height of the rectangle

#circle(x, y, radius) public

Draw a circle. Yields a Commands::Circle

Arguments

  • x - x coordinate (Float)
  • y - y coordinate (Float)
  • radius - radius of the circle (Float)

#image(image, x, y, width, height) public

Draws an image. Yields a Commands::Image

Arguments

  • image - a Hokusai::Image
  • x - x coordinate (Float)
  • y - y coordinate (Float)
  • width - width (Float)
  • height - height (Float)

#scissor_begin(x, y, width, height) public

Starts a scissor region

Arguments

  • x - x coordinate (Float)
  • y - y coordinate (Float)
  • width - width (Float)
  • height - height (Float)

#scissor_end public

ends scissor region

#blend_mode_begin(type) public

starts blend mode

Arguments

  • type - one of the values [:alpha, :multiply, :additive, :colors]

#blend_mode_end public

ends blend mode

#shader_begin public

starts a GLSL shader. Yields a Commands::ShaderBegin

#shader_end public

ends a shader

#rotation_begin(x, y, deg) public

starts a rotation

Arguments

  • x - x coordinate (Float)
  • y - y coordinate (Float)
  • deg - degress to rotate (Integer)

#rotation_end public

ends a rotation

#scale_begin public

starts a scale command

#scale_end public

ends scaling

#translation_begin(x, y) public

Starts a 2D translation

Arguments

  • x - x coordinate (Float)
  • y - y coordinate (Float)

#translation_end public

Ends a 2D translation

#texture(texture, x, y) public

Draws a texture

Arguments

  • texture - A Hokusai::Texture
  • x - x coordinate (Float)
  • y - y coordinate (Float)

#text(content, x, y) public

Draws text. Yields a Commands::Text

Arguments

  • content - the text content
  • x - x coord (Float)
  • y - y coord (Float)