1 ///
2 module isodi.raylib.anchor;
3 
4 import isodi.anchor;
5 import isodi.display;
6 import isodi.resource;
7 import isodi.position;
8 import isodi.raylib.resources;
9 
10 
11 @safe:
12 
13 
14 /// Anchor implementation for Raylib.
15 final class RaylibAnchor : Anchor, WithDrawableResources {
16 
17     /// Defines the order this anchor should be drawn in.
18     enum DrawOrder {
19 
20         /// Draw the anchor before other objects.
21         first,
22 
23         /// Draw the anchor at the same time as other objects, based on its position.
24         position,
25 
26         /// Draw this anchor after other objects.
27         last,
28 
29     }
30 
31     /// Ditto
32     auto drawOrder = DrawOrder.position;
33 
34     /// This delegate will be called every frame in order to draw. This is called within the display's Mode3D.
35     ///
36     /// If you rely on time within, `raylib.GetFrameTime` to get time passed between frames.
37     void delegate() callback;
38 
39     ///
40     this(Display display) {
41 
42         super(display);
43         callback = { };
44 
45     }
46 
47     ///
48     void reload() { }
49 
50     ///
51     void draw() {
52 
53         callback();
54 
55     }
56 
57 }