Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

orxonox/trunk: some 2d-adaptions

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.