1. Help me!

Again, anyone can help me?
I can create sprites (or shapes) with BMP and GIF files, but they are saved
like a rectangle, how can I use the "pure" image in it contents?
Eduardo Uemura Okada
e-mail: cool at art.com.br

new topic     » topic index » view message » categorize

2. Re: Help me!

Eduardo Uemura Okada wrote:

> Again, anyone can help me?
> I can create sprites (or shapes) with BMP and GIF files, but they are saved
> like a rectangle, how can I use the "pure" image in it contents?

        You can't :(

        You must save the image as a rectangular region... BUT draw the
backgroud (what you want to be transparent) in a color not used in any
other part of your image... then when you wan't to display the sprite,
just don't "pixel()" the ones that have the transparent color...
        I'm not going to give any code, cause that's not my speciality,
there are several good (and/or excelent) files on RDS homepage that
helps you achieve this.

--
Regards,
        Daniel Berstein
        architek at geocities.com
        http://www.geocities.com/SiliconValley/Heights/9316

new topic     » goto parent     » topic index » view message » categorize

3. Re: Help me!

> Again, anyone can help me?
> I can create sprites (or shapes) with BMP and GIF files, but they are saved
> like a rectangle, how can I use the "pure" image in it contents?

        Well, you need to save it as a rectuangular.
        But if you want to display it purely get GFXNEW3.Zip from the ftp.
        THen you just go to the video mode of your choice and do this:

----------------------------- Beginning of code -------------
here you change to the wanted video mode

        include gfx.e
        include image.e

        sequence temp_s
        temp_s = read_bitmap ("mybmp.bmp")

        sequence my_sprite
        my_sprite = MakeCS (      temp_s[2], {{{1}, CS_ANIM_TYPE_FREEZE}}),
{0}, {Monitor[VS_TYPE], Monitor[VS_SIZE][X], Monitor[VS_SIZE][Y]}   )

------------- end of code -----------------

        Now if you want to set the position do:
        Monitor = SetView (Monitor, {{100,100},{1000,1000}})
        Now the position is set to 100 by 100. Forget the last two, just
keep em high.
        If you want to draw your sprite do this:
        DrawCS(Monitor, my_sprite)
        There are also other ways to set the position of your sprite, but
this one will do fine. (Althrough it is not its original purpose)

Ralf Nieuwenhuijsen
nieuwen at xs4all.nl

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu