--- deliantra/Deliantra-Client/DC/UI.pm 2006/04/07 20:39:58 1.11 +++ deliantra/Deliantra-Client/DC/UI.pm 2006/04/07 20:55:32 1.12 @@ -59,7 +59,7 @@ my ($self) = @_; glPushMatrix; - glTranslate ($self->{x} || 0, $self->{y} || 0, 0); + glTranslate $self->{x}, $self->{y}, 0; $self->_draw; glPopMatrix; } @@ -74,12 +74,14 @@ package Crossfire::Client::Widget::Label; +our @ISA = Crossfire::Client::Widget::; + use SDL::OpenGL; sub new { - my ($class, $ttf, $text) = @_; + my ($class, $x, $y, $z, $ttf, $text) = @_; - my $self = $class->SUPER::new; + my $self = $class->SUPER::new (x => $x, y => $y, z => $z); $self->{texture} = new_from_ttf Crossfire::Client::Texture $ttf, $text; @@ -91,9 +93,15 @@ my $tex = $self->{texture}; + $self->{x}--; + + glEnable GL_BLEND; glEnable GL_TEXTURE_2D; + glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE; glBindTexture GL_TEXTURE_2D, $tex->{name}; + glColor 1, 1, 1; + glBegin GL_QUADS; glTexCoord 0, 0; glVertex 0 , 0; glTexCoord 0, 1; glVertex 0 , $tex->{height}; @@ -101,6 +109,7 @@ glTexCoord 1, 0; glVertex $tex->{width}, 0; glEnd; + glDisable GL_BLEND; glDisable GL_TEXTURE_2D; } @@ -142,6 +151,7 @@ sub _draw { glEnable GL_TEXTURE_2D; glEnable GL_BLEND; + glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE; my $map = $::CONN->{map};