-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathctx.pics
More file actions
39 lines (35 loc) · 1011 Bytes
/
ctx.pics
File metadata and controls
39 lines (35 loc) · 1011 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Module: Context
// Contains functions for creating contexts
Context :: module {
// Function: fromRect
// Creates a new context based on the one provided
//
// Parameters:
// ctx - (Reference) The graphic context
// x - (Number) The x position
// y - (Number) The y position
// w - (Number) The width
// h - (Number) The height
//
// Returns:
// - (Reference) A new graphics sub-context derived from the given context.
fromRect :: (ctx, x, y, w, h) = pic_nat_gfx_from_rect(ctx, x, y, w, h)
// Function: from
// Creates a new context based on the one provided
//
// Parameters:
// ctx - (Reference) The graphic context
//
// Returns:
// - (Reference) A new graphics context derived from the given context.
from :: (ctx) = pic_nat_gfx_from(ctx)
// Function: drop
// Frees the given context
//
// Parameters:
// ctx - (Reference) The graphic context
//
// Returns:
// - (Unit) Nothing
drop :: (ctx) = pic_nat_gfx_drop(ctx)
}