Author Topic: [nRGBlib] W.I.P - Colorful librairy for Ndless 3.1  (Read 21283 times)

0 Members and 1 Guest are viewing this topic.

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: [nRGBlib] W.I.P - Colorful librairy for Ndless 3.1
« Reply #45 on: April 17, 2012, 08:14:59 pm »
Yay!

What was that double-buffering thing?

Offline totorigolo

  • LV2 Member (Next: 40)
  • **
  • Posts: 24
  • Rating: +9/-0
    • View Profile
Re: [nRGBlib] W.I.P - Colorful librairy for Ndless 3.1
« Reply #46 on: April 19, 2012, 12:05:15 pm »
Yay!

What was that double-buffering thing?

If you are talking about "PS: For epic7, I haven't change your code, but I've just added the double-buffering :", I was seemingly wrong because I use only one buffer... I actually don't know how to name it, but it's a buffer ;)

If you are talking about the code, here it is : http://pastebin.com/UPmJT0nB. There are not several changes.

---------------------------------------------------

You can download the v0.3 samples here !
« Last Edit: April 19, 2012, 12:06:39 pm by totorigolo »
nRGBlib - A portable graphic library for Nspire !

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: [nRGBlib] W.I.P - Colorful librairy for Ndless 3.1
« Reply #47 on: April 19, 2012, 02:18:43 pm »
Cool! :D

I didn't know that I could add buffers like that.
Now that it looks like the flashing is no longer an issue, I can start making a better game! :D
* epic7 downloads 0.3
« Last Edit: April 19, 2012, 02:19:20 pm by epic7 »

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: [nRGBlib] W.I.P - Colorful librairy for Ndless 3.1
« Reply #48 on: April 22, 2012, 10:49:48 am »
How do I draw images/sub-images?

Also, could sub-images possibly be used as sprites?

Offline totorigolo

  • LV2 Member (Next: 40)
  • **
  • Posts: 24
  • Rating: +9/-0
    • View Profile
Re: [nRGBlib] W.I.P - Colorful librairy for Ndless 3.1
« Reply #49 on: April 22, 2012, 11:33:07 am »
* How do I draw images/sub-images?

Take a look at the RPG sample.

Code: [Select]
   // Create the sub-image
    ImageSubrect tile;
    setImage(&tile, &img);

    tile.w = CELL_SIZE;
    tile.h = CELL_SIZE;
    tile.x = 0;
    tile.y = 0;
    tile.offset_x = CELL_SIZE * 3;
    tile.offset_y = CELL_SIZE * 2;

    drawImagesubrect(&tile, buffer);

edit 1:
* Also, could sub-images possibly be used as sprites?
I don't know what is exactly a sprite, but you can use it to draw tiles from a tileset, or to draw an animated sprite.
A sub-image is just like a frame on an image, where you can change its height, width and position.

I hope you understand me...

edit 2:
Sub-Images are like SDL_Rect in these tuto : http://vally8.free.fr/coinprog/sdl/tut5/sprite.php - http://www.aaroncox.net/tutorials/2dtutorials/sdl_sprite.pdf. But SDL_SetColorKey() doesn't exists yet.

« Last Edit: April 24, 2012, 08:44:58 pm by totorigolo »
nRGBlib - A portable graphic library for Nspire !