Пример #1
0
bool Tammy::render(float time){

	glSprite(pos.x+20,pos.y+20,GL2D_CENTER,&sprTammy[0],false,0,1,1,0,0,0,0.5f);
	glSprite(pos.x,pos.y,GL2D_CENTER,&sprTammy[0]);
	std::vector<Animation*>::iterator iter = animations.begin();
	while (iter != animations.end())
	{
		glSprite(pos.x-23,pos.y-33,GL2D_CENTER,&sprTammy[Tammy_sequence[(*iter)->currentFrame]]);
		iter++;
	}
	return true;
}
Пример #2
0
static int
NDS_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
               const SDL_Rect * srcrect, const SDL_Rect * dstrect)
{
    NDS_RenderData *data = (NDS_RenderData *) renderer->driverdata;
    NDS_TextureData *txdat = (NDS_TextureData *) texture->driverdata;
	int dest_y;

	if (data->is_sub) {
		dest_y = dstrect->y;
	} else {
		dest_y = dstrect->y-SCREEN_HEIGHT;
	}

	if (texture->w == dstrect->w && texture->h == dstrect->h) {
		/* No scaling */
		glSprite(dstrect->x, dest_y, GL_FLIP_NONE, txdat->image);
	} else {
		/* Convert the scaling proportion into a 20.12 value. */
		s32 scale_w = divf32(dstrect->w << 12, texture->w << 12);
		s32 scale_h = divf32(dstrect->h << 12, texture->h << 12);

		glSpriteScaleXY(dstrect->x, dest_y, scale_w, scale_h, GL_FLIP_NONE, txdat->image);
	}

    return 0;
}
Пример #3
0
bool Intro::render(float time){
	
	//printf("%f\n",myTween.num);

	glSprite(0,0,GL2D_NO_SCALE,&spr[0],false,0,1,1,1,1,1,myTween.num);	
	glSprite(0,0,GL2D_NO_SCALE,&spr[0],false,0,1,1,1,1,1,0.5);	
	
	
	glSprite(400,200,GL2D_CENTER|GL2D_NO_SCALE|GL2D_COLOR_ADVANCED,&spr[1],false,0,1.2,1.2,-24,-100,100,100,-255.0f/255.0f,-255.0f/255.0f,-84.0f/255.0f,0.0f/255.0f);
	
	glSprite(370,380,GL2D_CENTER|GL2D_NO_SCALE,&spr[149]);//text
	glSprite(400,380,GL2D_CENTER|GL2D_NO_SCALE,&spr[150]);

	std::vector<Animation*>::iterator iter = animations.begin();
	while (iter != animations.end())
	{
		glSprite(400,200,GL2D_CENTER|GL2D_NO_SCALE|GL2D_COLOR_ADVANCED,&spr[intro_sequence[(*iter)->currentFrame]],false,0,1,1,100,100,100,100,41.0f/255.0f,-5.0f/255.0f,-255.0f/255.0f,0.0f/255.0f);
		iter++;
	}
	
	glSprite(400,300,GL2D_CENTER|GL2D_NO_SCALE,&spr[2],false,0,myTween.num,myTween.num);//flare
	 
	if(loops%60<20){
		
	}else{
#ifdef FONT
		m_pFontAtlas->GetFont(AHB_36)->DrawStringShadow(400-width1_/2,400,"TOUCH TO START",0xffffff,0x0000CC);
#endif
	}

	return true;
}
Пример #4
0
bool Player::render(float time){
	cpVect pos= cpBodyGetPosition(playerBody);
	cpVect vel = cpBodyGetVelocity(playerBody);
	playerX=pos.x;
	playerY=pos.y;


	printf("%4.2f %4.2f\n", playerX, playerY);//512->10*3
	glSprite(playerX,playerY,GL2D_CENTER,&spr[0],false,0,0.01953125*3,0.01953125*3);
	return true;
}
Пример #5
0
void BitmapFont::Print( int x, int y, const char *text )
{
	unsigned char font_char;
	
	while( *text )
	{
		font_char = ( *(unsigned char*)text++ ) - 32;
		glSprite( x, y, GL_FLIP_NONE, &font_sprite[font_char] );
		x += font_sprite[font_char].width; 
	}
	
}
Пример #6
0
void GLFont::PrintVertical(int x, int y, const char *text)
{
	unsigned char font_char;
	
	while(*text)
	{
		font_char = (*(unsigned char*)text++) - 32;
		glSprite( x, y, GL_FLIP_NONE, &font_sprite[font_char] );

		y += font_sprite[font_char].height; 
	}

}
Пример #7
0
void BitmapFont::PrintCentered( int x, int y, const char *text )
{

	unsigned char font_char;
	int total_width = 0;
	char *o_text = (char*)text;
	
	while( *text )
	{
		font_char = ( *(unsigned char*)text++ ) - 32;
		total_width += font_sprite[font_char].width; 
	}
	
	x = (SCREEN_WIDTH - total_width) / 2; 
	
	text = o_text;
	while( *text )
	{
		font_char = (*(unsigned char*)text++) - 32;
		glSprite( x, y, GL_FLIP_NONE, &font_sprite[font_char] );
		x += font_sprite[font_char].width; 
	}
}