December 03, 2020, 01:07:05 pm

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Welcome

Started by Ionic Wind Support Team, March 11, 2006, 10:32:58 am

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Protected

That's pretty cool Paul. Can you use PNGs as sprites? WIth alpha channel support?

Also, it would be nice if the image data (or music data) could be loaded from a string instead of a file. I plan on bundling all the info required for my 2D environment into a single file, and it's clumsy if I have to write down all the separate files in a temp folder when the file is being loaded...

This is a completely unrelated question, and maybe it was already asked somewhere else in the forums, but any plans for an easy-sockets library? I mean, one with not only raw TCP/UDP functionality but also the most commonly used protocols already implemented... HTTP, FTP, maybe NTP... It would add value to Aurora :P

Ionic Wind Support Team

Ionic Wind Support Team

seberbach

Quote from: Ionic Wizard on April 09, 2006, 08:39:18 am


Also have a few sound classes that I've been working on for managing midi, waves, and sound effects. 

My lack of posts recently just means I have my head down working ;)



I am very interested in sound classes, not just for games, but for transforming one commercial/artistic sound format, as played or recorded in real time, into another.

More particularly, there is much difficulty (contoversy and hesitation) in professional circles, surrounding any standardizing of recording and playback formats, such as how do you manipulate, concatenate, make multichannel, etc. even the lowly .WAV files? Really, there should be no limit to the number of simultaneous channels. (other than limits of the hardware bandwidth)

Which is left, right, center? Which is rear? Overhead? How many channels? How to compress?  Microsoft is being looked toward to "make a standard", (because anyone who tries will have thjjeir innovation co-opted if they do it well) but where is it?  I can't hold my breath forever.

Steve

Steve

Ionic Wind Support Team

The limit is determined by hardware.  There is a bit more standardization now then there was a few years back. DirectSound works with any manufacturers sound card but the bandwidth is still limited by the DSP chip used by the card.

Professional audio cards are available that have true 8 and 16 channel output, without needing to mix through software or a DSP.  Those cards are very pricey.

http://www.digigram.com/products/getinfo.htm?prod_key=11600
http://www.digitalaudio.com/DIGITALAUDIO/myarticles.asp?P=5215&S=75&PubID=4401&UT=admin&UID=520

If your into digital recording on a budget then you'll need at least a 4 channel card, dedicated hard drive for streaming the raw input data without any loss, and a good sequencing program. 

Paul.
Ionic Wind Support Team

Protected

Thanks for pointing out about socket tools, I didn't notice ~_~

QuoteThat's pretty cool Paul. Can you use PNGs as sprites? WIth alpha channel support?

Also, it would be nice if the image data (or music data) could be loaded from a string instead of a file. I plan on bundling all the info required for my 2D environment into a single file, and it's clumsy if I have to write down all the separate files in a temp folder when the file is being loaded...


Any answer to this?  ;D

Ionic Wind Support Team

No PNG yet ;)  But it will be added.

You can store any data in resources.  You can also create a sprite through code just by writing to a buffer.
Ionic Wind Support Team

Zen

Yay PNG Support!!! im guessing this will also support PNG transparency.

Thank god for that. I tried to make an XML driven 2D interface but gave up because there was no PNG support.

Lewis

Protected

That's great news  :)

Ionic Wind Support Team

Moving along ;)

Should have an update tonight.... finally.  Or tomorrow morning depedning on what the wife has planned for me.  The code below represents the basic structure of the 2D classes.  The screen class is derived from CWindow making it easy to use any of the API based graphic commands with a 2D surface. 

It also allows you to derive your own class from C2DScreen if you want to use message handlers and such.  But it is not necessary as all input can be handled directly from the DirectInput class.  Or just by checking for keypresses. 

By using this class structure you can use windowed/full screen mode by just changing one line of code. 


Code Select

global sub main()
{
C2DScreen s;
int fps;
int block = 0;
int dir = 1;
int frame = 0;
int s2frame = 0;
int s2xdir = 4;
int s2ydir = -4;
int x = 100;
int x2 = 0;
int y = 200;
int y2 = 400;
int ydir = 4;
int xdir = 4;
//s.CreateFullScreen(800,600,16);
s.CreateWindowed(0,0,800,600,AWS_CAPTION|AWS_VISIBLE|AWS_SIZE,0,"2D Test",NULL);
s.SetStretchedFlip(false);
C2DSurface *back = s.GetBack();
C2DSprite sprite1,sprite2;
if(!sprite1.Load(s,getstartpath() + "Mouth.bmp",0,0,3,TRUE))
{
MessageBox(s,"unable to load sprite",getstartpath() + "Mouth.bmp");
}
if(!sprite2.Load(s,getstartpath() + "Mouth.bmp",0,0,3,TRUE))
{
MessageBox(s,"unable to load sprite",getstartpath() + "Mouth.bmp");
}
sprite1.SetMaskColor(RGB(87,87,87));
sprite1.SetRenderMode(RENDER_TRANSROTOZOOM);
sprite1.SetAngleD(180);
sprite2.SetShadowOffset(-20,-20);
sprite2.SetMaskColor(RGB(87,87,87));
sprite2.SetAlpha(180);
do
{
Back->Fill(RGB(0,50,255));
s.WriteText( 180,0,"PRESS LEFTMOUSE TO CLOSE, FPS: " + NumToStr(fps));
//play with the sprites
sprite1.SetFrame(frame);
//sprite1.RenderXY(back,s.Mousex()-10,s.Mousey());
sprite1.RenderXY(back,x,y);
sprite2.SetFrame(s2frame);
//draw a sprite and an alpha shadow
sprite2.SetRenderMode(RENDER_TRANSSHADOW);
sprite2.RenderXY(back,x2,y2);
sprite2.SetRenderMode(RENDER_TRANS);
sprite2.RenderXY(back,x2,y2);

fps = s.Flip(1);

IF sprite1.CollisionTest(sprite2,1)
{
xdir = -xdir;
s2xdir = -s2xdir;
}

//adjust sprite1 direction
x+=xdir;
if((x + sprite1.GetWidth()) > 800 | x < 0 )
xdir = -xdir;
y+=ydir;
if((y + sprite1.GetHeight()) > 600 | y < 0 )
ydir = -ydir;

frame += ((x2%10) = 0);
IF frame > 2
frame = 0;

//adjust sprite2 direction
x2 += s2xdir;
if((x2 + sprite2.GetWidth()) > 800 | x2 < 0 )
s2xdir = -s2xdir;
y2+= s2ydir;
if((y2 + sprite2.GetHeight()) > 600 | y2 < 0 )
s2ydir = -s2ydir;

s2frame += ((x2%10) = 0);
IF s2frame > 2
s2frame = 0;


} until GetKeyState(0x01);
s.CloseScreen();
return 0;
}


Ionic Wind Support Team

Zen

Wow this looks well thought through Paul. I could never of thought of a better design if i did it myself :D
Keep up the good work.

Lewis

LarryMc

Awh shucks!
That's so easy I'll let my driver do it! ;)
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library