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_transform new_transform; |
73 asc_node_set_position2f(node, ASC_VEC2F( |
74 asc_transform_identity(new_transform); |
|
75 asc_transform_translate2f(new_transform, ASC_VEC2F( |
|
76 (int) bottom_right.x - (int) text_size.width - 10, |
74 (int) bottom_right.x - (int) text_size.width - 10, |
77 (int) bottom_right.y - (int) text_size.height - 10 |
75 (int) bottom_right.y - (int) text_size.height - 10 |
78 )); |
76 )); |
79 asc_node_transform_set(node, new_transform); |
|
80 } |
77 } |
81 } |
78 } |
82 |
79 |
83 static void scale_backdrop(AscBehavior *behavior) { |
80 static void scale_backdrop(AscBehavior *behavior) { |
84 // scale the backdrop to the size of the window |
81 // scale the backdrop to the size of the window |
206 asc_context_quit(); |
205 asc_context_quit(); |
207 } |
206 } |
208 |
207 |
209 // player rotation |
208 // player rotation |
210 if (asc_key_pressed(ASC_KEY(LEFT))) { |
209 if (asc_key_pressed(ASC_KEY(LEFT))) { |
211 asc_transform_roll_origin(spaceship->transform, asc_rad(-90), ASC_VEC3F(32, 32, 0)); |
210 asc_node_roll_deg(spaceship, -90); |
212 asc_node_update_transform(spaceship); |
211 asc_node_update_transform(spaceship); |
213 } |
212 } |
214 |
213 |
215 // debug-key for clearing the shader registry |
214 // debug-key for clearing the shader registry |
216 if (asc_key_pressed(ASC_KEY(S))) { |
215 if (asc_key_pressed(ASC_KEY(S))) { |