Changeset 11612 for lang/d

Show
Ignore:
Timestamp:
05/15/08 01:57:12 (6 months ago)
Author:
omega
Message:

画面リサイズだいたい対応

Location:
lang/d/koke/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • lang/d/koke/trunk/clickable.d

    r6347 r11612  
    6666         
    6767        void draw(bool selected,bool onMouse){ 
     68                int x = cast(int)position.x; 
     69                int y = cast(int)position.y; 
     70                if( x < 0 ) x += hell2.getScreenWidth(); 
     71                if( y < 0 ) y += hell2.getScreenHeight(); 
     72                 
    6873                if(type_style[type] == LRG){ 
    6974                        // イメージボタン大 
    7075                        if(selected){                   // 選択状態 
    71                                 Hell_drawTexture("menu" , cast(int)position.x , cast(int)position.y 
     76                                Hell_drawTexture("menu" , x , y 
    7277                                                , getWidth() * 2 , 0 , getWidth() , getHeight()); 
    73                                 Hell_drawTexture("menu" , cast(int)position.x , cast(int)position.y 
     78                                Hell_drawTexture("menu" , x , y 
    7479                                                , 0 , (cast(int)type + 1) * getHeight() 
    7580                                                , getWidth() , getHeight() 
    7681                                                ,1,1,0, 255,255,255); 
    7782                        }else if(onMouse){              // onMouse状態 
    78                                 Hell_drawTexture("menu" , cast(int)position.x , cast(int)position.y 
     83                                Hell_drawTexture("menu" , x , y 
    7984                                                , getWidth() , 0 , getWidth() , getHeight()); 
    80                                 Hell_drawTexture("menu" , cast(int)position.x , cast(int)position.y 
     85                                Hell_drawTexture("menu" , x , y 
    8186                                                , 0 , (cast(int)type + 1) * getHeight() 
    8287                                                , getWidth() , getHeight() 
    8388                                                ,1,1,0, 64,64,64); 
    8489                        }else{                                  // 他 
    85                                 Hell_drawTexture("menu" , cast(int)position.x , cast(int)position.y 
     90                                Hell_drawTexture("menu" , x , y 
    8691                                                , 0 , 0 , getWidth() , getHeight()); 
    87                                 Hell_drawTexture("menu" , cast(int)position.x , cast(int)position.y 
     92                                Hell_drawTexture("menu" , x , y 
    8893                                                , 0 , (cast(int)type + 1) * getHeight() 
    8994                                                , getWidth() , getHeight() 
     
    95100                        int alpha = (onMouse || selected) ? 255 : 128; 
    96101                        if(selected){                   // 選択状態 
    97                                 Hell_drawTexture("menu" , cast(int)position.x , cast(int)position.y 
     102                                Hell_drawTexture("menu" , x , y 
    98103                                                , 242 , (cast(int)type - TYPE.ECONOMY) * getHeight() 
    99104                                                , getWidth() , getHeight() 
    100105                                                ,1,1,0, 255,255,255,alpha); 
    101106                        }else{                                  // 非選択状態 
    102                                 Hell_drawTexture("menu" , cast(int)position.x , cast(int)position.y 
     107                                Hell_drawTexture("menu" , x , y 
    103108                                                , 242 , (cast(int)type - TYPE.ECONOMY) * getHeight() 
    104109                                                , getWidth() , getHeight() 
     
    110115                        int alpha = (onMouse || selected) ? 255 : 128; 
    111116                        if(selected){                   // 選択状態 
    112                                 Hell_drawTexture("menu" , cast(int)position.x , cast(int)position.y 
     117                                Hell_drawTexture("menu" , x , y 
    113118                                                , 306 , (cast(int)type - TYPE.STOP) * getHeight() 
    114119                                                , getWidth() , getHeight() 
    115120                                                ,1,1,0, 255,255,255,alpha); 
    116121                        }else{                                  // 非選択状態 
    117                                 Hell_drawTexture("menu" , cast(int)position.x , cast(int)position.y 
     122                                Hell_drawTexture("menu" , x , y 
    118123                                                , 306 , (cast(int)type - TYPE.STOP) * getHeight() 
    119124                                                , getWidth() , getHeight() 
  • lang/d/koke/trunk/gamecore.d

    r11608 r11612  
    106106                // 画面下・ツールメニュー 
    107107                menu = new ClickablePool(false /* 非選択状態は選べない */); 
    108                 menu.add("del" , new Vec3(getScreenWidth() - ImageButton.BUTTON_WIDTH*4 
    109                         , getScreenHeight() - ImageButton.BUTTON_HEIGHT ,0) 
     108                menu.add("del" , new Vec3( -ImageButton.BUTTON_WIDTH*4 , -ImageButton.BUTTON_HEIGHT ,0) 
    110109                        , ImageButton.TYPE.DEL); 
    111                 menu.add("herbicide" , new Vec3(getScreenWidth() - ImageButton.BUTTON_WIDTH*3 
    112                         , getScreenHeight() - ImageButton.BUTTON_HEIGHT ,0) 
     110                menu.add("herbicide" , new Vec3( -ImageButton.BUTTON_WIDTH*3 , -ImageButton.BUTTON_HEIGHT ,0) 
    113111                        , ImageButton.TYPE.HERBICIDE); 
    114                 menu.add("manage_ray" , new Vec3(getScreenWidth() - ImageButton.BUTTON_WIDTH*2 
    115                         , getScreenHeight() - ImageButton.BUTTON_HEIGHT ,0) 
     112                menu.add("manage_ray" , new Vec3( -ImageButton.BUTTON_WIDTH*2 , -ImageButton.BUTTON_HEIGHT ,0) 
    116113                        , ImageButton.TYPE.MANAGE_RAY); 
    117                 menu.add("call_nico" , new Vec3(getScreenWidth() - ImageButton.BUTTON_WIDTH*1 
    118                         , getScreenHeight() - ImageButton.BUTTON_HEIGHT ,0) 
     114                menu.add("call_nico" , new Vec3( -ImageButton.BUTTON_WIDTH*1 , -ImageButton.BUTTON_HEIGHT ,0) 
    119115                        , ImageButton.TYPE.CALL_NICO); 
    120                 menu.add("up" , new Vec3(getScreenWidth() - ImageButton.BUTTON_WIDTH*2 
    121                         , getScreenHeight() - ImageButton.BUTTON_HEIGHT * 2 ,0) 
     116                menu.add("up" , new Vec3( -ImageButton.BUTTON_WIDTH*2 , -ImageButton.BUTTON_HEIGHT * 2 ,0) 
    122117                        , ImageButton.TYPE.UP); 
    123                 menu.add("fence" , new Vec3(getScreenWidth() - ImageButton.BUTTON_WIDTH*1 
    124                         , getScreenHeight() - ImageButton.BUTTON_HEIGHT * 2 ,0) 
     118                menu.add("fence" , new Vec3( -ImageButton.BUTTON_WIDTH*1 , -ImageButton.BUTTON_HEIGHT * 2 ,0) 
    125119                        , ImageButton.TYPE.FENCE); 
    126120                 
    127121                // 画面上・チャートスイッチ 
    128122                chart_switch = new ClickablePool(); 
    129                 chart_switch.add("on" , new Vec3(getScreenWidth() - 64*2 , 0 ,0) 
     123                chart_switch.add("on" , new Vec3( -64*2 , 0 ,0) 
    130124                        , ImageButton.TYPE.CHART); 
    131125                 
    132126                // 画面上・エコノミースイッチ 
    133127                economy_switch = new ClickablePool(); 
    134                 economy_switch.add("on" , new Vec3(getScreenWidth() - 64 , 0 ,0) 
     128                economy_switch.add("on" , new Vec3( -64 , 0 ,0) 
    135129                        , ImageButton.TYPE.ECONOMY); 
    136130                 
    137131                // 画面上・速度調整スイッチ 
    138132                speed_switch = new ClickablePool(false /* 非選択状態は選べない */); 
    139                 speed_switch.add("play" , new Vec3(getScreenWidth() - 32*3 , 16 ,0) 
     133                speed_switch.add("play" , new Vec3( -32*3 , 16 ,0) 
    140134                        , ImageButton.TYPE.PLAY); 
    141                 speed_switch.add("stop" , new Vec3(getScreenWidth() - 32*4 , 16 ,0) 
     135                speed_switch.add("stop" , new Vec3( -32*4 , 16 ,0) 
    142136                        , ImageButton.TYPE.STOP); 
    143                 speed_switch.add("ksk" , new Vec3(getScreenWidth() - 32*2 , 16 ,0) 
     137                speed_switch.add("ksk" , new Vec3( -32*2 , 16 ,0) 
    144138                        , ImageButton.TYPE.KSK); 
    145                 speed_switch.add("danger" , new Vec3(getScreenWidth() - 32*1 , 16 ,0) 
     139                speed_switch.add("danger" , new Vec3( -32*1 , 16 ,0) 
    146140                        , ImageButton.TYPE.DANGER); 
    147141        } 
     
    436430                // fps/cpu 
    437431                Hell_drawFPS( 8 , getScreenHeight() - 24 ); 
    438                  
    439                  
    440         Hell_drawFont(std.string.toString(Hell_getMouseX()) ~ " / " ~ std.string.toString(Hell_getMouseY()) , 
    441                       8, 
    442                       40, 
    443                       2, 
    444                       255, 255, 255 
    445                       ); 
    446432        } 
    447433         
  • lang/d/koke/trunk/hell2.d

    r11608 r11612  
    240240        { 
    241241                g_videoFlags |= SDL_RESIZABLE; 
    242                 std.stdio.writefln("RESIZABLE"); 
    243242        } 
    244243