Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5380 in orxonox.OLD for branches/2d-recalc/src/lib/graphics/render2D


Ignore:
Timestamp:
Oct 15, 2005, 1:49:17 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: some 2d-adaptions

Location:
branches/2d-recalc/src/lib/graphics/render2D
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2d-recalc/src/lib/graphics/render2D/element_2d.cc

    r5378 r5380  
    221221  else if (!strcmp(layer, "below-all"))
    222222    this->setLayer(E2D_BELOW_ALL);
     223}
     224
     225
     226void Element2D::setSize2Dpx(int x, int y)
     227{
     228  this->setSize2D((float)(x)/(float)GraphicsEngine::getInstance()->getResolutionX(), (float)(y)/(float)GraphicsEngine::getInstance()->getResolutionY());
     229}
     230
     231
     232void Element2D::setSizeX2Dpx(int x)
     233{
     234  this->setSizeX2D((float)x/(float)GraphicsEngine::getInstance()->getResolutionX());
     235}
     236
     237
     238void Element2D::setSizeY2Dpx(int y)
     239{
     240  this->setSizeY2D((float)y/(float)GraphicsEngine::getInstance()->getResolutionY());
     241}
     242
     243int Element2D::getSizeX2Dpx() const
     244{
     245  return (int)((float)this->getSizeX2D()*GraphicsEngine::getInstance()->getResolutionX());
     246}
     247
     248int Element2D::getSizeY2Dpx() const
     249{
     250  return (int)((float)this->getSizeY2D()*GraphicsEngine::getInstance()->getResolutionY());
    223251}
    224252
  • branches/2d-recalc/src/lib/graphics/render2D/element_2d.h

    r5378 r5380  
    100100
    101101    inline void setSize2D(float x, float y) { this->sizeX = x, this->sizeY = y; };
     102    void setSize2Dpx(int x, int y);
    102103    inline void setSizeX2D(float x) { this->sizeX = x; };
     104    void setSizeX2Dpx(int x);
    103105    inline void setSizeY2D(float y) { this->sizeY = y; };
     106    void setSizeY2Dpx(int y);
    104107    inline float getSizeX2D() const { return this->sizeX; };
     108    int getSizeX2Dpx() const;
    105109    inline float getSizeY2D() const { return this->sizeY; };
     110    int getSizeY2Dpx() const;
    106111
    107112    // LIKE PNODE
Note: See TracChangeset for help on using the changeset viewer.