Jypeli
5
The simple game programming library
Grid.cs
Siirry tämän tiedoston dokumentaatioon.
1
using
System
;
2
using
Jypeli
;
3
4
namespace
Jypeli
5
{
6
public
class
Grid
7
{
8
public
Color
Color
{
get
;
set
; }
9
public
Vector
CellSize
{
get
;
set
; }
10
11
public
Grid
()
12
{
13
Color
=
Color
.
Green
;
14
CellSize
=
new
Vector
( 10, 10 );
15
}
16
17
public
Vector
SnapToLines
(
Vector
v )
18
{
19
Vector
result;
20
result.
X
= Math.Round( v.
X
/
this
.CellSize.X ) * this.
CellSize
.
X
;
21
result.
Y
= Math.Round( v.
Y
/
this
.CellSize.Y ) * this.
CellSize
.
Y
;
22
return
result;
23
}
24
}
25
}
Jypeli.Grid
Definition:
Grid.cs:6
Jypeli.Color.Green
static readonly Color Green
Vihreä.
Definition:
Color.cs:644
System
Jypeli
Jypeli.Vector.Y
double Y
Definition:
Vector.cs:275
Jypeli.Vector.X
double X
Definition:
Vector.cs:274
Jypeli.Color
Väri.
Definition:
Color.cs:13
Jypeli.Vector
2D-vektori.
Definition:
Vector.cs:56
Jypeli.Grid.CellSize
Vector CellSize
Definition:
Grid.cs:9
Jypeli.Grid.SnapToLines
Vector SnapToLines(Vector v)
Definition:
Grid.cs:17
Jypeli.Grid.Grid
Grid()
Definition:
Grid.cs:11
Jypeli
Grid.cs
Generoinut projektille Jypeli Fri Sep 15 2017 21:57:27
1.8.13