mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-08-11 17:17:42 +03:00
Added UILoader.
--HG-- branch : dev
This commit is contained in:
@@ -1,10 +1,6 @@
|
||||
#include <eepp/ee.hpp>
|
||||
|
||||
EE::Window::Window * win = NULL;
|
||||
float circ = 0, circ2 = 0;
|
||||
int op = 1;
|
||||
ArcDrawable arcDrawable( 200, 64 );
|
||||
CircleDrawable circleDrawableMask( 150, 64 );
|
||||
|
||||
void mainLoop()
|
||||
{
|
||||
@@ -26,34 +22,8 @@ void mainLoop()
|
||||
win->close();
|
||||
}
|
||||
|
||||
circ += win->getElapsed().asMilliseconds() * 0.5f * op;
|
||||
circ2 += win->getElapsed().asMilliseconds() * 0.75f;
|
||||
|
||||
if ( op == 1 && circ > 340 )
|
||||
{
|
||||
op = -1;
|
||||
}
|
||||
else if ( op == -1 && circ < 20 )
|
||||
{
|
||||
op = 1;
|
||||
}
|
||||
|
||||
Vector2f winCenter( win->getWidth() * 0.5f, win->getHeight() * 0.5f );
|
||||
|
||||
ClippingMask * clippingMask = Renderer::instance()->getClippingMask();
|
||||
|
||||
circleDrawableMask.setPosition( winCenter );
|
||||
|
||||
clippingMask->setMaskMode( ClippingMask::Exclusive );
|
||||
clippingMask->clearMasks();
|
||||
clippingMask->appendMask( circleDrawableMask );
|
||||
clippingMask->stencilMaskEnable();
|
||||
|
||||
arcDrawable.setArcAngle( circ );
|
||||
arcDrawable.setArcStartAngle( circ2 );
|
||||
arcDrawable.draw( winCenter );
|
||||
|
||||
clippingMask->stencilMaskDisable();
|
||||
// Draw a circle
|
||||
p.drawCircle( Vector2f( win->getWidth() * 0.5f, win->getHeight() * 0.5f ), 200, 50 );
|
||||
|
||||
// Draw frame
|
||||
win->display();
|
||||
@@ -70,12 +40,6 @@ EE_MAIN_FUNC int main (int argc, char * argv [])
|
||||
// Set window background color
|
||||
win->setClearColor( Color( 50, 50, 50 ) );
|
||||
|
||||
arcDrawable.setColor( ColorA( 0, 255, 0, 150 ) );
|
||||
arcDrawable.setFillMode( DRAW_FILL );
|
||||
|
||||
circleDrawableMask.setColor( ColorA( 0, 255, 0, 150 ) );
|
||||
circleDrawableMask.setFillMode( DRAW_FILL );
|
||||
|
||||
// Set the MainLoop function and run it
|
||||
// This is the application loop, it will loop until the window is closed.
|
||||
// This is only a requirement if you want to support Emscripten builds ( WebGL + Canvas ).
|
||||
|
||||
Reference in New Issue
Block a user