changeset 133:e7caa277d7e8

add createStringFont()
author Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
date Thu, 21 Jul 2011 18:16:26 +0900
parents d84ee8b2cfd9
children bb8bbca19a5f
files gFont.cc gFont.o gSprite.cc magoroku schedule.cc schedule.o
diffstat 6 files changed, 9 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/gFont.cc	Thu Jul 21 17:25:59 2011 +0900
+++ b/gFont.cc	Thu Jul 21 18:16:26 2011 +0900
@@ -24,7 +24,7 @@
 static unsigned int  sp_counter;
 static bool          flag_spriteInited = false; // スプライトロードフラグ
 //static TEXTURE *font_tex;
-
+extern SceneGraphPtr root;
 
 static void
 gFont_Init_Png(const char *texname)
@@ -159,6 +159,7 @@
 gFont_SetString(const char *str, int x, int y)
 {
   int number;
+  char *ch_str = (char *)str;
 
   while (*str != '\0') {
     number = get_number_char(*str);
@@ -167,8 +168,9 @@
     x += (int)CHAR_W_SIZE*1.5;
   }
   
-  //droot->createStringFont(root,"As",80,640,480,0x00ff00ff);
-
+  //SceneGraphPtr font = droot->createSceneGraph();
+  droot->createStringFont(root,ch_str,50,/*640*/x,/*480*/y,0x00ff00ff);
+  //droot->setSceneData(font);
 }
 
 /*
Binary file gFont.o has changed
--- a/gSprite.cc	Thu Jul 21 17:25:59 2011 +0900
+++ b/gSprite.cc	Thu Jul 21 18:16:26 2011 +0900
@@ -184,7 +184,7 @@
     }
   }
   root->addChild(object);
-
+  //droot->createStringFont(root,"As",80,640,480,0x00ff00ff);
   float scale[] = {my_scale,my_scale,1};
   
   if(test == 1){
Binary file magoroku has changed
--- a/schedule.cc	Thu Jul 21 17:25:59 2011 +0900
+++ b/schedule.cc	Thu Jul 21 18:16:26 2011 +0900
@@ -227,7 +227,7 @@
   //ここを現在通らないらしい。
   if (game->play_id==1){
     if (blink_count < 35) {
-      gFont_SetString("PUSH START !!", 170, 380);
+      gFont_SetString("PUSH START !!", 320, 480);
     }
     blink_count = (blink_count > 70) ? 0 : blink_count + 1;
 
@@ -270,7 +270,7 @@
   gSprite_PutSprite(true,R_ARROW, 750, 200, TEST_Z_GRID, 0);
   gSprite_PutSprite(true,L_ARROW, 450, 200, TEST_Z_GRID, 0 );
 
-  gFont_SetString("SELECT CAR", 180, 50);
+  gFont_SetString("SELECT CAR", 320, 480);
 
   if (pad.right == 1) {
     game->car_id =
@@ -338,7 +338,7 @@
     
   /* 点滅 */
   if (blink_count < 35) {
-    gFont_SetString("GAME START !!", 170, 380);
+    gFont_SetString("GAME START !!", 220, 580);
   }
   blink_count = (blink_count > 70) ? 0 : blink_count + 1;
 
Binary file schedule.o has changed