Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   C++ Builder (https://www.clubdelphi.com/foros/forumdisplay.php?f=13)
-   -   Como Insertar Flash en Builder C++ 4.0 (https://www.clubdelphi.com/foros/showthread.php?t=14567)

BuilderSystems 24-09-2004 04:48:13

Como Insertar Flash en Builder C++ 4.0
 
como hago para implementar una animacion de flash en builder c++ 4.0..
que libreria tengo que declarar para poder utilizar estas animaciones

barman 27-09-2004 12:09:31

Tendrias que instalar unos componentes .OCX que econtraras en la web de macromedia, ahora reproducir un archivo flash es facilito, pero como quieras interactuar builder con flash es maj bien jodidito, me refiero a menus flash, botones, etc.

BuilderSystems 27-09-2004 18:42:56

Gracias
 
Cita:

Empezado por barman
Tendrias que instalar unos componentes .OCX que econtraras en la web de macromedia, ahora reproducir un archivo flash es facilito, pero como quieras interactuar builder con flash es maj bien jodidito, me refiero a menus flash, botones, etc.

gracias por responder..
ahora mi pregunta es ...
estos conponentes queme mencionas son para reproducir en flash , osea queno tiene nada que ver con el builder cierto...?
pero estos me sirven para poder hacer mejores mis animaciones..
creo que para que me entiendas mejor te voy a decir que es lo que voy a hacer..
me toca hacer un packman..pero no congalletas si no con fantasmas que persiguen a este..no se si me hago entender..
cualquiera cosa me escribes....

barman 28-09-2004 16:33:52

Pues si lo haces con builder aqui va un ejemplo que rula en internet desde hace tiempo

Solo hay que poner 1 TTimer y 2 TImage...

Código:
void __fastcall TForm1::FormCreate(TObject *Sender)
{
Timer1->Enabled = false;
DoubleBuffered = true;

Form1->Caption = "GAME";
Form1->ClientWidth = 200;
Form1->ClientHeight = 200;
Form1->BorderStyle = bsDialog;
Form1->Position = poDesktopCenter;

Image1->Top = 0;
Image1->Left = 0;
Image1->Width = 200;
Image1->Height= 200;
Image1->Visible = false;

Image2->Top = 0;
Image2->Left = 0;
Image2->Width = 200;
Image2->Height= 200;


jx = 100;
jy = 175;
sf = 0;
ef = 1;
ex = 100;
ey = 15;
eh = 0;
score = 0;
miss = 0;


Image1->Canvas->Brush->Color = clBlack;
Image1->Canvas->FillRect( Rect( 0, 0, 200,200) );

Timer1->Interval = 45;
Timer1->Enabled = true;



}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormKeyDown(TObject *Sender, WORD &Key,
TShiftState Shift)
{
switch ( Key )
{
case VK_SPACE: KS = 1;
break;
case VK_LEFT : K4 = 1;
break;
case VK_RIGHT: K6 = 1;
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormKeyUp(TObject *Sender, WORD &Key,
TShiftState Shift)
{
switch ( Key )
{
case VK_SPACE: KS = 0;
break;
case VK_LEFT : K4 = 0;
break;
case VK_RIGHT: K6 = 0;
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Timer1Timer(TObject *Sender)
{

Image1->Canvas->FillRect( Rect( 0, 0, 200, 200 ) );


Image1->Canvas->Font->Size = 11;
Image1->Canvas->Font->Color = clSilver;
Image1->Canvas->TextOut( 20, 1, "Score" );
Image1->Canvas->TextOut( 132, 1, "Miss" );

Image1->Canvas->Font->Color = clFuchsia;
Image1->Canvas->TextOut( 66, 1, IntToStr( score ) );
Image1->Canvas->TextOut( 175, 1, IntToStr( miss ) );

Image1->Canvas->Font->Size = 16;

if ( miss > 2 ) {
Image1->Canvas->Font->Color = clYellow;
Image1->Canvas->TextOut( 50, 100, "Game Over" );
Timer1->Enabled = false;
}

if ( K4 == 1 ) {
if ( jx > 10 ) jx -= 5;
}
if ( K6 == 1 ) {
if ( jx < 185 ) jx += 5;
}

Image1->Canvas->Font->Color = clAqua;
Image1->Canvas->TextOut( jx-9, jy, "<>" );


if ( sf == 0 && KS == 1 ) {
sf = 1;
sx = jx;
sy = jy-5;
}

if ( sf == 1 ) {
sy -= 6;
Image1->Canvas->Font->Color = clYellow;
Image1->Canvas->TextOut( sx-9, sy, "¨" );

if ( (ex-sx) > -26 && (ex-sx) < 23 ) {
if ( (ey-sy) > -13 && (ey-sy) < 13 ) {
ef = 2;
sf = 0;
score += 10;
}
}

if ( sy < -10 ) {
++miss;
sf = 0;
}
}

if ( ef == 1 ) {
if ( eh == 0 ) {
ex -= 4;
if ( ex < 22 ) eh = 1;
} else {
ex += 4;
if ( ex > 195 ) eh = 0;
}
}


if ( ef == 1 ) {
Image1->Canvas->Font->Color = clRed;
Image1->Canvas->TextOut( ex-19, ey, "oo" );
} else {
Image1->Canvas->Font->Color = clYellow;
if ( ef%2 == 0 ) {
Image1->Canvas->TextOut( ex-19, ey, "oo" );
} else {
Image1->Canvas->TextOut( ex-19, ey, "oo" );
}
if ( ++ef > 20 ) ef = 0;
}

if ( ef == 0 ) {
ex = 100;
eh = random(2);
}
Image2->Canvas->CopyRect( Image2->Canvas->ClipRect,
Image1->Canvas, Image2->Canvas->ClipRect);
}
//---------------------------------------------------------------------------


class TForm1 : public TForm
{
__published: // IDE-managed Components
TImage *Image1;
TImage *Image2;
TTimer *Timer1;
void __fastcall FormCreate(TObject *Sender);
void __fastcall FormKeyDown(TObject *Sender, WORD &Key,
TShiftState Shift);
void __fastcall FormKeyUp(TObject *Sender, WORD &Key,
TShiftState Shift);
void __fastcall Timer1Timer(TObject *Sender);
private: // User declarations

int jx, jy;
int sx, sy;
int ex, ey;

int sf;
int ef;
int eh;

int score;
int miss;

int K4, K6, KS;

public: // User declarations
__fastcall TForm1(TComponent* Owner);
};

// y ya esta

BuilderSystems 29-09-2004 23:03:34

Primero Dejame Darte Las Gracias Por Poder Ayudarme...
Pero Si Te Doy Todo Por Partes Depronto No Puedas Entender Lo Que Voy A Hacer..
No Se Si De Alguna Forma Te Puedo Hacer Llegar El Documento En El Que Me Dicen Todas Las Especificaciones Para Hacer El Programa..
No Se Si Para La Proxima Vez Que Entres Me Dejes Tu E-mail..para Poder Enviartelo..


La franja horaria es GMT +2. Ahora son las 05:41:26.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi