Mercurial > MadButterfly
comparison examples/dynamic/main.c @ 453:84ce2d4a8c3f
Change interface of sprite loader.
- Users can set a path where sprites should be loaded from.
- Users must pass a module root to MBApp_Init() to specify path
for loading sprites.
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Wed, 05 Aug 2009 19:34:59 +0800 |
parents | 31b6633e3538 |
children | 9b8dda201ccb |
comparison
equal
deleted
inserted
replaced
452:cb10f3424f3a | 453:84ce2d4a8c3f |
---|---|
119 MyApp_InitContent() | 119 MyApp_InitContent() |
120 { | 120 { |
121 mb_button_t *b; | 121 mb_button_t *b; |
122 mb_sprite_t *sprite; | 122 mb_sprite_t *sprite; |
123 | 123 |
124 sprite = sprite_load(".libs/button", myApp->rdman, myApp->rdman->root_coord); | 124 sprite = sprite_load("button", myApp->rdman, myApp->rdman->root_coord); |
125 b = mb_button_new(myApp->rdman, sprite, "btn"); | 125 b = mb_button_new(myApp->rdman, sprite, "btn"); |
126 mb_button_add_onClick(b, test,NULL); | 126 mb_button_add_onClick(b, test,NULL); |
127 } | 127 } |
128 | 128 |
129 void draw_text() | 129 void draw_text() |
136 mb_obj_t *button; | 136 mb_obj_t *button; |
137 MyAppData data; | 137 MyAppData data; |
138 mb_timeval_t tmo,interval; | 138 mb_timeval_t tmo,interval; |
139 | 139 |
140 if (argc > 1) | 140 if (argc > 1) |
141 myApp = MBApp_Init(argv[1]); | 141 myApp = MBApp_Init(argv[1], ""); |
142 else | 142 else |
143 myApp = MBApp_Init(".libs/scene"); | 143 myApp = MBApp_Init("scene", ".libs"); |
144 data.currentscene=0; | 144 data.currentscene=0; |
145 draw_text(); | 145 draw_text(); |
146 MBApp_setData(myApp,&data); | 146 MBApp_setData(myApp,&data); |
147 MyApp_InitContent(); | 147 MyApp_InitContent(); |
148 get_now(&tmo); | 148 get_now(&tmo); |