Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5374 in orxonox.OLD for trunk/src/lib/shell


Ignore:
Timestamp:
Oct 13, 2005, 1:04:06 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: cool shell-commands for loading images and setting colors

Location:
trunk/src/lib/shell
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/shell/shell.cc

    r5373 r5374  
    4343    ->setAlias("hide");
    4444SHELL_COMMAND(textsize, Shell, setTextSize)
    45     ->describe("Sets the size of the Text (size, linespacing)")
     45    ->describe("Sets the size of the Text size, linespacing")
    4646    ->defaultValues(1, 15, 0);
     47SHELL_COMMAND(textcolor, Shell, setTextColor)
     48    ->describe("Sets the Color of the Shells Text (red, green, blue, alpha)")
     49    ->defaultValues(4, SHELL_DEFAULT_TEXT_COLOR);
     50SHELL_COMMAND(backgroundcolor, Shell, setBackgroundColor)
     51    ->describe("Sets the Color of the Shells Background (red, green, blue, alpha)")
     52    ->defaultValues(4, SHELL_DEFAULT_BACKGROUND_COLOR);
     53SHELL_COMMAND(backgroundimage, Shell, setBackgroundImage)
     54    ->describe("sets the background image to load for the Shell");
    4755SHELL_COMMAND(font, Shell, setFont)
    4856    ->describe("Sets the font of the Shell")
     
    8290
    8391  this->rebuildText();
     92
    8493  this->setTextColor(SHELL_DEFAULT_TEXT_COLOR);
    8594  this->setBackgroundColor(SHELL_DEFAULT_BACKGROUND_COLOR);
     
    221230  this->backgroundMaterial->setTransparency(a);
    222231}
     232
     233/**
     234 * sets a nice background image to the Shell's background
     235 * @param fileName the filename of the Image to load
     236 */
     237void Shell::setBackgroundImage(const char* fileName)
     238{
     239  this->backgroundMaterial->setDiffuseMap(fileName);
     240}
     241
    223242
    224243/**
  • trunk/src/lib/shell/shell.h

    r5373 r5374  
    1616
    1717#define         SHELL_DEFAULT_FONT              "fonts/dpquake_.ttf"
    18 #define         SHELL_DEFAULT_TEXT_COLOR        1,0,0,1
    19 #define         SHELL_DEFAULT_BACKGROUND_COLOR  0,0,.8,.8
     18#define         SHELL_DEFAULT_TEXT_COLOR        1.0f, 0.0f, 0.0f, 1.0f
     19#define         SHELL_DEFAULT_BACKGROUND_COLOR  0.0f, 0.0f, 0.8f, 0.8f
    2020
    2121// FORWARD DECLARATION
     
    5858    void setTextColor(float r, float g, float b, float a);
    5959    void setBackgroundColor(float r, float g, float b, float a);
     60    void setBackgroundImage(const char* fileName);
    6061
    6162    void resetValues();
  • trunk/src/lib/shell/shell_command.cc

    r5329 r5374  
    504504          objectPointer = objectList->firstElement();
    505505      }
    506       printf("test\n");
    507506      // match a function.
    508507      if (commandClass != NULL && (fktPos == 1 || (fktPos == 2 && inputSplits.getCount() >= 3)))
Note: See TracChangeset for help on using the changeset viewer.