コード例 #1
0
void BackgroundActor::UpdateUVs(float horizontal, float vertical)
{
   Vector2 lowerLeft;
   Vector2 upperRight;
   GetUVs(lowerLeft, upperRight);

   lowerLeft.X += horizontal;
   lowerLeft.Y += vertical;
   upperRight.X += horizontal;
   upperRight.Y += vertical;

   SetUVs(lowerLeft, upperRight);      
}
コード例 #2
0
ファイル: Actor.cpp プロジェクト: chrishaukap/GameDev
Actor::Actor()
{
	SetColor(1.0f, 1.0f, 1.0f);
	SetAlpha(1.0f);
	SetSize(1.0f);
	SetRotation(0.0f);
	SetPosition(0.0f, 0.0f);
	SetUVs(Vector2(0.f, 0.f), Vector2(1.f, 1.f));
   SetTextureScales(1.0f, 1.0f);
	_name = "";

	_spriteNumFrames = 0;
	_spriteCurrentFrame = 0;
	_spriteTextureReferences[0] = -1; 
	_spriteFrameDelay = 0.0f;
    _displayListIndex = -1;

	_layer = 0;

    _drawShape = ADS_Square;
}
コード例 #3
0
Actor::Actor()
{
	SetColor(1.0f, 1.0f, 1.0f);
	SetAlpha(1.0f);
	SetSize(1.0f);
	SetRotation(0.0f);
	SetPosition(0.0f, 0.0f);
	SetUVs(Vector2(0.f, 0.f), Vector2(1.f, 1.f));
	SetName("");

	_spriteNumFrames = 0;
	_spriteCurrentFrame = 0;
	_spriteTextureReferences[0] = -1; //to avoid accidentally reusing textures
										// (outside of VS, this value could be initialized as
										// non-negative which leads to textures getting used
										// where they shouldn't (see Render() ) )
	_spriteFrameDelay = 0.0f;

	_layer = 0;

    _drawShape = ADS_Square;
}
コード例 #4
0
ファイル: Actor.cpp プロジェクト: MaliusArth/PixelArth
Actor::Actor()
{
	if (!__inittedActorCirclePoints)
	{
		Actor::_circleVertices[0] = 0.0f;
		Actor::_circleVertices[1] = 0.0f;
		Actor::_circleTextureCoords[0] = 0.5f;
		Actor::_circleTextureCoords[1] = 0.5f;
		for (int i=1; i < CIRCLE_DRAW_SECTIONS+2; i++)
		{
			Actor::_circleVertices[i*2]     = 0.5f * cos((float) MathUtil::TwoPi * i / CIRCLE_DRAW_SECTIONS);
			Actor::_circleVertices[(i*2)+1] = 0.5f * sin((float) MathUtil::TwoPi * i / CIRCLE_DRAW_SECTIONS);
			Actor::_circleTextureCoords[i*2]     = Actor::_circleVertices[i*2]     + 0.5f;
			Actor::_circleTextureCoords[(i*2)+1] = Actor::_circleVertices[(i*2)+1] + 0.5f;
		}
		__inittedActorCirclePoints = true;
	}

	SetColor(1.0f, 1.0f, 1.0f);
	SetAlpha(1.0f);
	SetSize(1.0f);
	SetRotation(0.0f);
	SetPosition(0.0f, 0.0f);
	SetUVs(Vector2(0.f, 0.f), Vector2(1.f, 1.f));
	_name = "";

	_spriteNumFrames = 0;
	_spriteCurrentFrame = 0;
	_spriteTextureReferences[0] = -1; 
	_spriteFrameDelay = 0.0f;
	_displayListIndex = -1;

	_layer = 0;

	_drawShape = ADS_Square;
}
コード例 #5
0
ファイル: Shape.cpp プロジェクト: nofxboy1234/sa
void Shape::FlipRight() {
  SetUVs(Vector2(0.0f, 0.0f), Vector2(1.0f, 1.0f));
  _facingRight = true;
}
コード例 #6
0
ファイル: Shape.cpp プロジェクト: nofxboy1234/sa
void Shape::FlipLeft() {
  SetUVs(Vector2(1.0f, 0.0f), Vector2(0.0f, 1.0f));
  _facingRight = false;
}