Constructor
new Constellation(name, connect, ctx, star_coord_list, ratio, width, height)
Takes star list which is an array of star coordinates and creates stars
Parameters:
Name |
Type |
Description |
name |
string
|
name of constellation |
connect |
JSONobject
|
the paths to connect all the stars in the constellation. |
ctx |
CanvasRenderingContext2D
|
|
star_coord_list |
Array
|
list of star coordinates |
ratio |
Number
|
scaling ratio along with background |
width |
Number
|
canvas width |
height |
Number
|
canvas height |
- Source:
Classes
- Constellation
Members
selected_number
Properties:
Name |
Type |
Description |
Get |
function
|
the number of selected stars in the constellation |
- Source:
selected_ratio
Properties:
Name |
Type |
Description |
Get |
function
|
constellation selected ratio |
- Source:
Methods
click(x, y)
Click event handler, pass click event to all stars in the constellation
Parameters:
Name |
Type |
Description |
x |
Number
|
coordinate |
y |
Number
|
coordinate |
- Source:
connectAll()
Properties:
Name |
Type |
Description |
Connect |
function
|
all the points in the constellation |
- Source:
draw(user_x, user_y)
Draw function, draw all stars in constellation
Parameters:
Name |
Type |
Description |
user_x |
Number
|
user view offset x |
user_y |
Number
|
user view offset y |
- Source:
setChosen(choice)
Set this constellation as chosen by the user
Parameters:
Name |
Type |
Description |
choice |
String
|
set contellation as choosen |
- Source:
setOffset(offset_x, offset_y)
Set the display offset
Parameters:
Name |
Type |
Description |
offset_x |
Number
|
user view offset |
offset_y |
Number
|
user view offset |
- Source:
update(user_x, user_y)
Update function, to be called by animation loop
Parameters:
Name |
Type |
Description |
user_x |
Number
|
user view offset x |
user_y |
Number
|
user view offset y |
- Source:
updateNew(user_x, user_y)
New update function if the current constellation is the final result.
Parameters:
Name |
Type |
Description |
user_x |
Number
|
user view offset x |
user_y |
Number
|
user view offset y |
- Source: