Added overloads to Draw/DrawRotated for int and float.
This commit is contained in:
parent
dee427ac89
commit
efe93334bb
@ -13,7 +13,7 @@
|
|||||||
File: ZE_ZImage.h <br>
|
File: ZE_ZImage.h <br>
|
||||||
Description: Header file for core ZEngine Image and Texture Object. <br>
|
Description: Header file for core ZEngine Image and Texture Object. <br>
|
||||||
Author(s): James Turk, Gamer Tazar <br>
|
Author(s): James Turk, Gamer Tazar <br>
|
||||||
$Id: ZE_ZImage.h,v 1.14 2003/02/10 04:55:48 cozman Exp $<br>
|
$Id: ZE_ZImage.h,v 1.15 2003/02/10 05:15:33 cozman Exp $<br>
|
||||||
|
|
||||||
\file ZE_ZImage.h
|
\file ZE_ZImage.h
|
||||||
\brief Definition file for ZImage.
|
\brief Definition file for ZImage.
|
||||||
@ -249,6 +249,16 @@ class ZImage
|
|||||||
\param x X coord to draw Image to.
|
\param x X coord to draw Image to.
|
||||||
\param y Y coord to draw Image to.
|
\param y Y coord to draw Image to.
|
||||||
**/
|
**/
|
||||||
|
void Draw(int x, int y) const;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Draw Image to Screen.
|
||||||
|
|
||||||
|
Draw Image to screen at specified location.
|
||||||
|
\since 0.8.3
|
||||||
|
\param x X coord to draw Image to.
|
||||||
|
\param y Y coord to draw Image to.
|
||||||
|
**/
|
||||||
void Draw(float x, float y) const;
|
void Draw(float x, float y) const;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -261,6 +271,16 @@ class ZImage
|
|||||||
**/
|
**/
|
||||||
void DrawRotated(int x, int y, float angle) const;
|
void DrawRotated(int x, int y, float angle) const;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Draw Image rotated to screen.
|
||||||
|
|
||||||
|
Image is rotated about it's own center by specified angle, then drawn to screen.
|
||||||
|
\param x X coord to draw Image to.
|
||||||
|
\param y Y coord to draw Image to.
|
||||||
|
\param angle Angle in degrees to rotate image.
|
||||||
|
**/
|
||||||
|
void DrawRotated(float x, float y, float angle) const;
|
||||||
|
|
||||||
/////////////
|
/////////////
|
||||||
//Accessors//
|
//Accessors//
|
||||||
/////////////
|
/////////////
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
File: ZE_ZImage.cpp <br>
|
File: ZE_ZImage.cpp <br>
|
||||||
Description: Implementation source file for core ZEngine Image or Texture Object. <br>
|
Description: Implementation source file for core ZEngine Image or Texture Object. <br>
|
||||||
Author(s): James Turk, Gamer Tazar <br>
|
Author(s): James Turk, Gamer Tazar <br>
|
||||||
$Id: ZE_ZImage.cpp,v 1.25 2003/02/10 04:55:48 cozman Exp $<br>
|
$Id: ZE_ZImage.cpp,v 1.26 2003/02/10 05:15:33 cozman Exp $<br>
|
||||||
|
|
||||||
\file ZE_ZImage.cpp
|
\file ZE_ZImage.cpp
|
||||||
\brief Source file for ZImage.
|
\brief Source file for ZImage.
|
||||||
@ -235,6 +235,11 @@ void ZImage::Bind() const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ZImage::Draw(int x, int y) const
|
||||||
|
{
|
||||||
|
Draw(static_cast<float>(x),static_cast<float>(y));
|
||||||
|
}
|
||||||
|
|
||||||
void ZImage::Draw(float x, float y) const
|
void ZImage::Draw(float x, float y) const
|
||||||
{
|
{
|
||||||
Bind();
|
Bind();
|
||||||
@ -248,6 +253,11 @@ void ZImage::Draw(float x, float y) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ZImage::DrawRotated(int x, int y, float angle) const
|
void ZImage::DrawRotated(int x, int y, float angle) const
|
||||||
|
{
|
||||||
|
DrawRotated(static_cast<float>(x),static_cast<float>(y),angle);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ZImage::DrawRotated(float x, float y, float angle) const
|
||||||
{
|
{
|
||||||
float cX,cY; //center variables
|
float cX,cY; //center variables
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
and the home of this Library is http://www.zengine.sourceforge.net
|
and the home of this Library is http://www.zengine.sourceforge.net
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
/*$Id: ZMusicTest.cpp,v 1.13 2003/01/12 19:00:19 cozman Exp $*/
|
/*$Id: ZMusicTest.cpp,v 1.14 2003/02/10 05:16:30 cozman Exp $*/
|
||||||
|
|
||||||
#include <ZEngine.h>
|
#include <ZEngine.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -95,7 +95,7 @@ void Test()
|
|||||||
|
|
||||||
engine->Clear(); //clear screen
|
engine->Clear(); //clear screen
|
||||||
for(int i=0; i < 4; i++)
|
for(int i=0; i < 4; i++)
|
||||||
text[i].Draw(0,i*50.0f);
|
text[i].Draw(0,i*50);
|
||||||
engine->Update(); //update the screen
|
engine->Update(); //update the screen
|
||||||
}
|
}
|
||||||
} while(!engine->QuitRequested()); //quit only when engine has encountered a quit request
|
} while(!engine->QuitRequested()); //quit only when engine has encountered a quit request
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
and the home of this Library is http://www.zengine.sourceforge.net
|
and the home of this Library is http://www.zengine.sourceforge.net
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
/*$Id: ZSoundTest.cpp,v 1.11 2003/01/12 19:00:22 cozman Exp $*/
|
/*$Id: ZSoundTest.cpp,v 1.12 2003/02/10 05:16:30 cozman Exp $*/
|
||||||
|
|
||||||
#include <ZEngine.h>
|
#include <ZEngine.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -91,7 +91,7 @@ void Test()
|
|||||||
|
|
||||||
engine->Clear(); //clear screen
|
engine->Clear(); //clear screen
|
||||||
for(int i=0; i < 6; i++)
|
for(int i=0; i < 6; i++)
|
||||||
text[i].Draw(0,i*50.0f);
|
text[i].Draw(0,i*50);
|
||||||
engine->Update(); //update the screen
|
engine->Update(); //update the screen
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
and the home of this Library is http://www.zengine.sourceforge.net
|
and the home of this Library is http://www.zengine.sourceforge.net
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
/*$Id: ZTimerTest.cpp,v 1.11 2003/01/12 19:00:25 cozman Exp $*/
|
/*$Id: ZTimerTest.cpp,v 1.12 2003/02/10 05:16:30 cozman Exp $*/
|
||||||
|
|
||||||
#include <ZEngine.h>
|
#include <ZEngine.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -108,7 +108,7 @@ void Test()
|
|||||||
engine->Clear(); //clear screen
|
engine->Clear(); //clear screen
|
||||||
|
|
||||||
for(int i=0; i <= 4; i++)
|
for(int i=0; i <= 4; i++)
|
||||||
text[i].Draw(0,i*50.0f);
|
text[i].Draw(0,i*50);
|
||||||
|
|
||||||
engine->Update(); //update the screen
|
engine->Update(); //update the screen
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user