Class AS::Canvas
In: lib/as_canvas.rb
Parent: Object

A class for manipulating the viewport. Using a Canvas object you can easily have the view follow a character or rotate or scale the view.

Methods

bounds   mouse   new   set   set_bounds   slew_angle   slew_pos   slew_scale   xmax   xmin   ymax   ymin  

Attributes

angle  [RW] 
h  [RW] 
kx  [RW] 
ky  [RW] 
pos  [RW] 
scale  [RW] 
w  [RW] 

Public Class methods

Create a new Canvas object. kx and ky are the key point (origin offset).

Set the bounds of the viewport. Convenience method, to set a simple viewport without createing a Canvas object.

Public Instance methods

Get bounds of the canvas. (Only valid when angle = 0)

Transform the mouse to world coordinates

Set the viewport to this canvas.

Slew to an angle. factor designates how much of a change should actually occur.

Slew to a position. factor designates how much of a change should actually occur.

Slew to a scale. factor designates how much of a change should actually occur.

Get the maximum x value of the canvas. (Only valid when angle = 0)

Get the minimum x value of the canvas. (Only valid when angle = 0)

Get the maximum x value of the canvas. (Only valid when angle = 0)

Get the minimum y value of the canvas. (Only valid when angle = 0)

[Validate]