Page 1 of 1

Blue rectangle gfx source

Posted: 17 Feb 2015, 20:51
by lighthouse64
Does anyone know where the blue rectangle source is??? Because I think I might be able to replace it...

Posted: 17 Feb 2015, 21:00
by Wohlstand
lighthouse64 wrote:Does anyone know where the blue rectangle source is??? Because I think I might be able to replace it...

Blue rectangle is a vector rectangle drawn with OpenGL function:

Code: Select all

    glDisable(GL_TEXTURE_2D);
    glColor4f( 0.f, 0.f, 1.f, 1.f);
    glBegin( GL_QUADS );
        glVertex2f( player.left(), player.top());
        glVertex2f( player.right(), player.top());
        glVertex2f( player.right(),  player.bottom());
        glVertex2f( player.left(),  player.bottom());
    glEnd();


just a dummy GFX.
Everybody can draw it even in the Paint ;-)

Full source here:
https://github.com/Wohlhabend-Networks/PGE-Project/blob/master/Engine/scenes/level/lvl_player.cpp#L685

When I will implement the reading of playable character's graphics, instead blue rectangle will be used playable character sprite from graphics folder of config pack.

Posted: 18 Feb 2015, 7:36
by lighthouse64
Wohlstand wrote:
lighthouse64 wrote:Does anyone know where the blue rectangle source is??? Because I think I might be able to replace it...

Blue rectangle is a vector rectangle drawn with OpenGL function:

Code: Select all

 glDisable(GL_TEXTURE_2D);
 glColor4f( 0.f, 0.f, 1.f, 1.f);
 glBegin( GL_QUADS );
 glVertex2f( player.left(), player.top());
 glVertex2f( player.right(), player.top());
 glVertex2f( player.right(), player.bottom());
 glVertex2f( player.left(), player.bottom());
 glEnd();


just a dummy GFX.
Everybody can draw it even in the Paint ;-)

Full source here:
https://github.com/Wohlhabend-Networks/PGE-Project/blob/master/Engine/scenes/level/lvl_player.cpp#L685

When I will implement the reading of playable character's graphics, instead blue rectangle will be used playable character sprite from graphics folder of config pack.
Oh. Wait, isn't it in the pge folder??? I couldn't find it :p

Posted: 18 Feb 2015, 8:32
by Kevsoft
Nope, currently the player is only beeing painted with code.

Posted: 18 Feb 2015, 20:15
by lighthouse64
Kevsoft wrote:Nope, currently the player is only beeing painted with code.
Oh... but isn't there a source for the code?

Posted: 18 Feb 2015, 20:16
by Wohlstand
lighthouse64 wrote:
Kevsoft wrote:Nope, currently the player is only beeing painted with code.
Oh... but isn't there a source for the code?
No, it generating from scratch by C++ code:

Code: Select all

    glDisable(GL_TEXTURE_2D);
    glColor4f( 0.f, 0.f, 1.f, 1.f);
    glBegin( GL_QUADS );
        glVertex2f( player.left(), player.top());
        glVertex2f( player.right(), player.top());
        glVertex2f( player.right(),  player.bottom());
        glVertex2f( player.left(),  player.bottom());
    glEnd();

Posted: 18 Feb 2015, 22:09
by lighthouse64
Wohlstand wrote:
lighthouse64 wrote:
Kevsoft wrote:Nope, currently the player is only beeing painted with code.
Oh... but isn't there a source for the code?
No, it generating from scratch by C++ code:

Code: Select all

 glDisable(GL_TEXTURE_2D);
 glColor4f( 0.f, 0.f, 1.f, 1.f);
 glBegin( GL_QUADS );
 glVertex2f( player.left(), player.top());
 glVertex2f( player.right(), player.top());
 glVertex2f( player.right(), player.bottom());
 glVertex2f( player.left(), player.bottom());
 glEnd();
oh. :( I guess I can't really do anything. I'm a noob at a lot of languages. :(

Posted: 18 Feb 2015, 22:13
by Wohlstand
lighthouse64 wrote:
Wohlstand wrote:
lighthouse64 wrote:
Kevsoft wrote:Nope, currently the player is only beeing painted with code.
Oh... but isn't there a source for the code?
No, it generating from scratch by C++ code:

Code: Select all

 glDisable(GL_TEXTURE_2D);
 glColor4f( 0.f, 0.f, 1.f, 1.f);
 glBegin( GL_QUADS );
 glVertex2f( player.left(), player.top());
 glVertex2f( player.right(), player.top());
 glVertex2f( player.right(), player.bottom());
 glVertex2f( player.left(), player.bottom());
 glEnd();
oh. :( I guess I can't really do anything. I'm a noob at a lot of languages. :(
Don't worry, now I working with playable character system, so instead of blue rectangle will be a normal playable character sprite with animation ;-)

Posted: 18 Feb 2015, 23:50
by tb1024
lighthouse64 wrote:
Wohlstand wrote:
lighthouse64 wrote:
Kevsoft wrote:Nope, currently the player is only beeing painted with code.
Oh... but isn't there a source for the code?
No, it generating from scratch by C++ code:

Code: Select all

 glDisable(GL_TEXTURE_2D);
 glColor4f( 0.f, 0.f, 1.f, 1.f);
 glBegin( GL_QUADS );
 glVertex2f( player.left(), player.top());
 glVertex2f( player.right(), player.top());
 glVertex2f( player.right(), player.bottom());
 glVertex2f( player.left(), player.bottom());
 glEnd();
oh. :( I guess I can't really do anything. I'm a noob at a lot of languages. :(
The rectangle does not use a texture. Since it has just a single color, you can just use the renderer. If you ever played a bit on a 3d creator with some level of "professionalness" you'd understand it.
But this snippet is fairly readable for someone who knows basics on 3d.

Posted: 19 Feb 2015, 22:26
by lighthouse64
tb1024 wrote:
lighthouse64 wrote:
Wohlstand wrote:
lighthouse64 wrote:
Kevsoft wrote:Nope, currently the player is only beeing painted with code.
Oh... but isn't there a source for the code?
No, it generating from scratch by C++ code:

Code: Select all

 glDisable(GL_TEXTURE_2D);
 glColor4f( 0.f, 0.f, 1.f, 1.f);
 glBegin( GL_QUADS );
 glVertex2f( player.left(), player.top());
 glVertex2f( player.right(), player.top());
 glVertex2f( player.right(), player.bottom());
 glVertex2f( player.left(), player.bottom());
 glEnd();
oh. :( I guess I can't really do anything. I'm a noob at a lot of languages. :(
The rectangle does not use a texture. Since it has just a single color, you can just use the renderer. If you ever played a bit on a 3d creator with some level of "professionalness" you'd understand it.
But this snippet is fairly readable for someone who knows basics on 3d.
Wait, isn't it possible to add any squares to the rectangle?

Posted: 20 Feb 2015, 3:45
by tb1024
lighthouse64 wrote:
tb1024 wrote:
lighthouse64 wrote:
Wohlstand wrote:
lighthouse64 wrote:
Kevsoft wrote:Nope, currently the player is only beeing painted with code.
Oh... but isn't there a source for the code?
No, it generating from scratch by C++ code:

Code: Select all

 glDisable(GL_TEXTURE_2D);
 glColor4f( 0.f, 0.f, 1.f, 1.f);
 glBegin( GL_QUADS );
 glVertex2f( player.left(), player.top());
 glVertex2f( player.right(), player.top());
 glVertex2f( player.right(), player.bottom());
 glVertex2f( player.left(), player.bottom());
 glEnd();
oh. :( I guess I can't really do anything. I'm a noob at a lot of languages. :(
The rectangle does not use a texture. Since it has just a single color, you can just use the renderer. If you ever played a bit on a 3d creator with some level of "professionalness" you'd understand it.
But this snippet is fairly readable for someone who knows basics on 3d.
Wait, isn't it possible to add any squares to the rectangle?
Yes, it is, but in that case texture-mapping would be more polygon-efficient.

Posted: 20 Feb 2015, 18:05
by lighthouse64
Ok. Are you saying it wouldn't stick to the rectangle?

Posted: 17 Jun 2017, 17:20
by Wohlstand
This thread is no more actual since PGE Engine is long time can draw playable character animations