test/snake/snake.c

changeset 189
2c063b225183
parent 186
e9bb4d4f88a8
child 193
ddf690c0b36b
equal deleted inserted replaced
188:5ece6e3acc84 189:2c063b225183
68 // TODO: this should be replaced with some sort of UI layout manager 68 // TODO: this should be replaced with some sort of UI layout manager
69 AscSceneNode *node = behavior->node; 69 AscSceneNode *node = behavior->node;
70 if (asc_test_flag(node->flags, ASC_SCENE_NODE_GRAPHICS_UPDATED) || asc_active_window->resized) { 70 if (asc_test_flag(node->flags, ASC_SCENE_NODE_GRAPHICS_UPDATED) || asc_active_window->resized) {
71 asc_vec2u bottom_right = asc_active_window->dimensions; 71 asc_vec2u bottom_right = asc_active_window->dimensions;
72 asc_vec2u text_size = ((AscText*)node)->dimension; 72 asc_vec2u text_size = ((AscText*)node)->dimension;
73 asc_set_position2d( 73 asc_transform new_transform;
74 node, 74 asc_transform_identity(new_transform);
75 (int)bottom_right.x - (int)text_size.width - 10, 75 asc_transform_translate2f(new_transform, ASC_VEC2F(
76 (int)bottom_right.y - (int)text_size.height - 10 76 (int) bottom_right.x - (int) text_size.width - 10,
77 ); 77 (int) bottom_right.y - (int) text_size.height - 10
78 ));
79 asc_node_transform_set(node, new_transform);
78 } 80 }
79 } 81 }
80 82
81 static void scale_backdrop(AscBehavior *behavior) { 83 static void scale_backdrop(AscBehavior *behavior) {
82 // scale the backdrop to the size of the window 84 // scale the backdrop to the size of the window

mercurial