Author Topic: Ritchie's QB64 Sprite Library (updated V0.2 10/27/12)  (Read 12262 times)

TerryRitchie

  • Hero Member
  • *****
  • Posts: 2806
  • Press any key to continue or any other key to quit
Re: Ritchie's QB64 Sprite Library
« Reply #15 on: July 15, 2012, 02:17:32 pm »
The sprite library contains no such features, but I actually did work on a path scripter of sorts when making a program called "Made With QB64" some time back. I scripted the movement of 100's of bees on the screen at once and thought about expanding this idea to the sprite library but never got around to it.  Here is the original post to that program: http://www.qb64.net/forum/index.php?topic=3824.msg38672#msg38672

I still think it's a good idea. I had planned on updating the library this summer until Galleon started talking about new graphics capabilities and engines and thought I would hold off a bit to see what kind of new speed and power I would have available to play with.

Your ideas into how the script should work look great.  Feel free to add to the library in any way you wish or use it as a basis (fork it) for your own library project as well.  Much of the math code contained in the library is based off UnseenMachine's original GDK, which in turn was based off contributions from many of the finest math wizards on the site at the time. (Zom-B, Harixxx ... where are you?)


SMcNeill

  • Moderator
  • Hero Member
  • *****
  • Posts: 6071
Re: Ritchie's QB64 Sprite Library
« Reply #16 on: July 15, 2012, 04:08:07 pm »
I was going to work up an action script similar to what I posted, for where I've been playing around making text altering routines.  When I get it up and going, we'll see how hard it'll be to adapt and add into your sprite library.

Got to admit, I was mainly looking into your library at the moment just to see how you handled moving, rotating, and working with them yourself.   It harms nothing to look at things from a different perspective, and it seems we often go about getting things done by different ways.  Your graphic text input approach works (quite well), and it's nothing like mine.  I think yours used on timer routines, whereas mine creates external files and waits for a finished code to be issued.   ;)

It's one thing I love about programming -- seeing all the different ways that people will come up with to produce the (almost) same results.  Yours is very nice code, and I was curious how you handled the animations, since my way of thinking had changed so much while working up my own.

I'd started with several small, individual routines, then thought of combing them all into one massive routine, and now it's evolved back to multiple routines, but with the same image handle...   Who knows what I'll end up with by the time I finally finish.  ;)
http://bit.ly/TextImage -- Library of QB64 code to manipulate text and images, as a BM library.

http://bit.ly/Color32 -- A set of color CONST for use in 32 bit mode, as a BI library.

TerryRitchie

  • Hero Member
  • *****
  • Posts: 2806
  • Press any key to continue or any other key to quit
Re: Ritchie's QB64 Sprite Library
« Reply #17 on: July 15, 2012, 04:40:02 pm »
In version 2.1 of GLInput, the latest posted, I completely removed the timers in favor of one routine, GLIUPDATE, that handles everything on screen.

Excellent, I hope my code helped. Like I said, some of my code in the sprite library is culled from Unseen's code, Galleon's code and code that others helped Unseen with.  You'll notice in my source as well that I annotated every one of those sources, so going back to their roots is easy.

The inspiration for the way my libraries work comes from QB64 itself and the way Galleon produces LONG pointers (handles) to objects.  My button library was the first use of this style and I use it for almost everything I do now.

codeguy

  • Hero Member
  • *****
  • Posts: 3945
  • what the h3ll did i name that code?
    • stuff at dkm
Re: Ritchie's QB64 Sprite Library
« Reply #18 on: July 16, 2012, 10:16:17 am »
The sprite library contains no such features, but I actually did work on a path scripter of sorts when making a program called "Made With QB64" some time back. I scripted the movement of 100's of bees on the screen at once and thought about expanding this idea to the sprite library but never got around to it.  Here is the original post to that program: http://www.qb64.net/forum/index.php?topic=3824.msg38672#msg38672

I still think it's a good idea. I had planned on updating the library this summer until Galleon started talking about new graphics capabilities and engines and thought I would hold off a bit to see what kind of new speed and power I would have available to play with.

Your ideas into how the script should work look great.  Feel free to add to the library in any way you wish or use it as a basis (fork it) for your own library project as well.  Much of the math code contained in the library is based off UnseenMachine's original GDK, which in turn was based off contributions from many of the finest math wizards on the site at the time. (Zom-B, Harixxx ... where are you?)
and of course that nagging codeguy ;D yes, we have a few math wizards here. yes, i miss the veterans who have been busy or been kidnapped by aliens 8^).

unseenmachine

  • Hero Member
  • *****
  • Posts: 3663
  • Make the Game not the ENGINE!!!
Re: Ritchie's QB64 Sprite Library
« Reply #19 on: September 14, 2012, 02:11:07 pm »
Path based movement is something i have intended to add to GDK for a while i just never got round to it till now and even then it took me a while to crack it due to GDK using vectors to move stuff but i got it working.

Terry please feel free to assimilate anything you need to add this function to your sprite lib. I am going to add support for loop and reverse options, once thats done i'll add it to GDK and post an update in the GDK thread.

Code (requires UnseenGDK) :
Code: [Select]
GDK_MathX
GDK_Screen_SetRes Main&, 800, 800, 32, 0

DIM Ship AS Sprite, PathPoints(4) AS XY, ShipPath AS Path


GDK_Sprite_New Ship, "Ship1.PNG", 1, 1, 1, 1
GDK_Sprite_Show Ship
GDK_Sprite_SetAlpha Ship, _RGB(255, 0, 255)
GDK_Sprite_SetRotationPoint Ship, Ship.Width / 2, Ship.Height / 2

'// Load path points
GDK_Path_New ShipPath, PathPoints(), 5

ShipPath.Vector.Speed = 20

'// Main loop
DO
  _LIMIT 50
  CLS
  PRINT ShipPath.Vector.X, ShipPath.Vector.Y

  GDK_Path_Update ShipPath, PathPoints()
  GDK_Sprite_Draw Ship, ShipPath.Vector, 1

  _DISPLAY
LOOP


REM $INCLUDE:'UnseenGDK.BM'


TYPE Path
  Vector AS Vector
  NumPoints AS INTEGER
  CurrentPoint AS INTEGER
  LastVector AS Vector
  HitTargetX AS INTEGER
  HitTargetY AS INTEGER
END TYPE


SUB GDK_Path_New (Path AS Path, PathPoint() AS XY, NumPoints%)
FOR i% = 0 TO NumPoints% - 1
  READ PathPoint(i%).X, PathPoint(i%).Y
NEXT
Path.Vector.Rotation = -atan2(PathPoint(0).Y - PathPoint(1).Y, PathPoint(0).X - PathPoint(1).X) + (2 * ATN(1))
Path.Vector.X = PathPoint(0).X
Path.Vector.Y = PathPoint(0).Y
Path.LastVector = Path.Vector
Path.NumPoints = NumPoints%
END SUB


SUB GDK_Path_Update (Path AS Path, XY() AS XY)
Path.LastVector = Path.Vector
GDK_Vector_Update Path.Vector
IF Path.CurrentPoint = Path.NumPoints - 1 THEN

ELSEIF Path.CurrentPoint < Path.NumPoints - 2 THEN
  IF NOT Path.HitTargetX THEN IF IsWithinRange(XY(Path.CurrentPoint + 1).X, Path.LastVector.X, Path.Vector.X) THEN Path.HitTargetX = -1
  IF NOT Path.HitTargetY THEN IF IsWithinRange(XY(Path.CurrentPoint + 1).Y, Path.LastVector.Y, Path.Vector.Y) THEN Path.HitTargetY = -1
  IF Path.HitTargetX AND Path.HitTargetY THEN
    Path.CurrentPoint = Path.CurrentPoint + 1
    Path.Vector.Rotation = -atan2(XY(Path.CurrentPoint).Y - XY(Path.CurrentPoint + 1).Y, XY(Path.CurrentPoint).X - XY(Path.CurrentPoint + 1).X) + (2 * ATN(1))
    Path.HitTargetX = 0
    Path.HitTargetY = 0
  END IF
END IF
END SUB


FUNCTION IsWithinRange% (Target%, MinRange%, MaxRange%)
IF Target% >= MinRange% AND Target% <= MaxRange% THEN
  IsWithinRange% = -1
ELSEIF Target% <= MinRange% AND Target% >= MaxRange% THEN
  IsWithinRange% = -1
ELSE
  IsWithinRange% = 0
END IF
END FUNCTION

DATA 0,0,400,700,500,400,800,50,0,0


Required sprite (stick in your qb 64 folder) : https://dl.dropbox.com/u/8822351/Ship1.PNG

Any questions feel free to ask.

Unseen
« Last Edit: September 14, 2012, 02:31:41 pm by unseenmachine »

TerryRitchie

  • Hero Member
  • *****
  • Posts: 2806
  • Press any key to continue or any other key to quit
Re: Ritchie's QB64 Sprite Library
« Reply #20 on: September 14, 2012, 04:37:42 pm »
Thanks Unseen :)

Good to see you back by the way.  Don't stay away so long next time ;)

unseenmachine

  • Hero Member
  • *****
  • Posts: 3663
  • Make the Game not the ENGINE!!!
Re: Ritchie's QB64 Sprite Library
« Reply #21 on: September 15, 2012, 07:04:18 am »
Here's a vastly improved version. Now you change the speed of the object at each set of move co-ordinates and you can also set it to reverse along the same path in a loop.

Same sprite as previous: https://dl.dropbox.com/u/8822351/Ship1.PNG

Code :
Code: [Select]
'// UnseenGDK Patch - Path Movement v.01

GDK_Screen_SetRes Main&, 800, 800, 32, 0

DIM Ship AS Sprite, PathPoints(7) AS PathPoint, ShipPath AS Path


GDK_Sprite_New Ship, "Ship1.PNG", 1, 1, 1, 1
GDK_Sprite_Show Ship
GDK_Sprite_SetAlpha Ship, _RGB(255, 0, 255)
GDK_Sprite_SetRotationPoint Ship, Ship.Width / 2, Ship.Height / 2

'// Load path points
GDK_Path_New ShipPath, PathPoints(), 8, 1

ShipPath.Vector.Speed = 10

'// Main loop
DO
  _LIMIT 30
  CLS

  GDK_Path_Update ShipPath, PathPoints()
  GDK_Sprite_Draw Ship, ShipPath.Vector, 1

  _DISPLAY
LOOP

DATA 0,50,10,750,50,20,750,750,20,50,750,20,50,50,20,400,400,20,400,50,20,400,150,20

REM $INCLUDE:'UnseenGDK.BM'


TYPE Path
  Vector AS Vector
  NumPoints AS INTEGER
  CurrentPoint AS INTEGER
  LastVector AS Vector
  HitTargetX AS INTEGER
  HitTargetY AS INTEGER
  Reverse AS INTEGER
  IsReversing AS INTEGER
END TYPE

TYPE PathPoint
  X AS INTEGER
  Y AS INTEGER
  Speed AS INTEGER
END TYPE


SUB GDK_Path_New (Path AS Path, PathPoint() AS PathPoint, NumPoints%, Reverse%)
FOR i% = 0 TO NumPoints% - 1
  READ PathPoint(i%).X, PathPoint(i%).Y, PathPoint(i%).Speed
NEXT
Path.Vector.Rotation = -atan2(PathPoint(0).Y - PathPoint(1).Y, PathPoint(0).X - PathPoint(1).X) + (2 * ATN(1))
Path.Vector.X = PathPoint(0).X
Path.Vector.Y = PathPoint(0).Y
Path.LastVector = Path.Vector
Path.NumPoints = NumPoints%
Path.Reverse = Reverse%
END SUB


SUB GDK_Path_Update (Path AS Path, PathPoint() AS PathPoint)
Path.LastVector = Path.Vector
Path.Vector.Speed = PathPoint(Path.CurrentPoint).Speed
GDK_Vector_Update Path.Vector
IF Path.IsReversing THEN
  IF Path.CurrentPoint > 0 THEN
    IF NOT Path.HitTargetX THEN IF IsWithinRange(PathPoint(Path.CurrentPoint - 1).X, Path.LastVector.X, Path.Vector.X) THEN Path.HitTargetX = -1
    IF NOT Path.HitTargetY THEN IF IsWithinRange(PathPoint(Path.CurrentPoint - 1).Y, Path.LastVector.Y, Path.Vector.Y) THEN Path.HitTargetY = -1
    IF Path.HitTargetX AND Path.HitTargetY THEN
      IF Path.CurrentPoint > 1 THEN
        Path.CurrentPoint = Path.CurrentPoint - 1
        Path.Vector.Rotation = -atan2(Path.Vector.Y - PathPoint(Path.CurrentPoint - 1).Y, Path.Vector.X - PathPoint(Path.CurrentPoint - 1).X) + (2 * ATN(1))
      ELSE '// First point
        Path.CurrentPoint = 0
        IF Path.Reverse THEN
          Path.IsReversing = 0
          Path.Vector.Rotation = -atan2(Path.Vector.Y - PathPoint(Path.CurrentPoint + 1).Y, Path.Vector.X - PathPoint(Path.CurrentPoint + 1).X) + (2 * ATN(1))
        END IF
      END IF
      Path.HitTargetX = 0
      Path.HitTargetY = 0
    END IF
  END IF
ELSE
  IF Path.CurrentPoint < Path.NumPoints - 1 THEN
    IF NOT Path.HitTargetX THEN IF IsWithinRange(PathPoint(Path.CurrentPoint + 1).X, Path.LastVector.X, Path.Vector.X) THEN Path.HitTargetX = -1
    IF NOT Path.HitTargetY THEN IF IsWithinRange(PathPoint(Path.CurrentPoint + 1).Y, Path.LastVector.Y, Path.Vector.Y) THEN Path.HitTargetY = -1
    IF Path.HitTargetX AND Path.HitTargetY THEN
      IF Path.CurrentPoint < Path.NumPoints - 2 THEN
        Path.CurrentPoint = Path.CurrentPoint + 1
        Path.Vector.Rotation = -atan2(Path.Vector.Y - PathPoint(Path.CurrentPoint + 1).Y, Path.Vector.X - PathPoint(Path.CurrentPoint + 1).X) + (2 * ATN(1))
      ELSE '// Last point
        Path.CurrentPoint = Path.NumPoints - 1
        IF Path.Reverse THEN
          Path.IsReversing = -1
          Path.Vector.Rotation = -atan2(Path.Vector.Y - PathPoint(Path.CurrentPoint - 1).Y, Path.Vector.X - PathPoint(Path.CurrentPoint - 1).X) + (2 * ATN(1))
        END IF
      END IF
      Path.HitTargetX = 0
      Path.HitTargetY = 0
    END IF
  END IF
END IF
END SUB


FUNCTION IsWithinRange% (Target%, MinRange%, MaxRange%)
IF Target% >= MinRange% AND Target% <= MaxRange% THEN
  IsWithinRange% = -1
ELSEIF Target% <= MinRange% AND Target% >= MaxRange% THEN
  IsWithinRange% = -1
ELSE
  IsWithinRange% = 0
END IF
END FUNCTION


Unseen

TerryRitchie

  • Hero Member
  • *****
  • Posts: 2806
  • Press any key to continue or any other key to quit
Re: Ritchie's QB64 Sprite Library (updated V0.2 10/27/12)
« Reply #22 on: October 27, 2012, 08:32:35 pm »
*BUMP*

Updated version 0.2 - see original post in thread.

small no more

  • Guest
Re: Ritchie's QB64 Sprite Library (updated V0.2 10/27/12)
« Reply #23 on: January 31, 2013, 04:39:04 pm »
Hello,

I downloaded your sprite library. and have been reading the tutorial. I have a screen pic that I made in paint and a sprite sheet I downloaded off the internet to make a slot machine, but I don't really understand.  Any help appreciated.

attached is the background pic and the sprite sheet. As far as i have figured out is that the pics on the sprite sheet are 96x96 I guess.

Thank You

TerryRitchie

  • Hero Member
  • *****
  • Posts: 2806
  • Press any key to continue or any other key to quit
Re: Ritchie's QB64 Sprite Library (updated V0.2 10/27/12)
« Reply #24 on: January 31, 2013, 07:51:12 pm »
Hello,

I downloaded your sprite library. and have been reading the tutorial. I have a screen pic that I made in paint and a sprite sheet I downloaded off the internet to make a slot machine, but I don't really understand.  Any help appreciated.

attached is the background pic and the sprite sheet. As far as i have figured out is that the pics on the sprite sheet are 96x96 I guess.

Thank You

Sprite sheets need to be set up with all sprites being the same size.  After looking at the sprite sheet you supplied I noticed that this was not the case.  I went ahead and figured out how big the sprites really are, and they came out to 74x86.  Since there are 12 sprites I created a new sprite sheet with the dimensions of 444x172 to fit all 12 sprites equally on the sheet.  This is key, because they way I wrote the sprite library any sprite sheet loaded must have equal size sprites.

The code I have included below is just one way the loading of the sprites could be handled.  It loads the sprite sheet, loads the sprites, and then places all 12 sprites on the screen.  Below the code box is a link to the new sprite sheet I created that you will need for the example program to work properly.

Code: [Select]
'$INCLUDE:'spritetop.bi'

'**
'** slot.png is 444x172 in size which divides out equally to 12 sprites at 74 pixels wide by 86 pixels high.
'**
'** The sprite library numbers the sprites from 1 to 12 starting from the upper left of the sheet, moving to
'** the right, then once the end of the row is reached, dropping down to the next row beginning at the left
'** again, like so:
'**
'** SLOT.PNG is loaded in by SPRITESHEETLOAD configured as follows
'**
'** | <--------------------------- 444 pixels ----------------------------> |
'** | <- 74 --> | <- 74 --> | <- 74 --> | <- 74 --> | <- 74 --> | <- 74 --> |
'** +-----------+-----------+-----------+-----------+-----------+-----------+ --------
'** | SPRITE 1  | SPRITE 2  | SPRITE 3  | SPRITE 4  | SPRITE 5  | SPRITE 6  |  ^    ^
'** |   still   |   still   |   still   |   still   |   still   |   still   |  86   |
'** |   orange  |   seven   |    bar    |   pear    |  banana   |   cherry  |  v
'** +-----------+-----------+-----------+-----------+-----------+-----------+ ---  172 pixels
'** | SPRITE 7  | SPRITE 8  | SPRITE 9  | SPRITE 10 | SPRITE 11 | SPRITE 12 |  ^
'** |  moving   |  moving   |  moving   |  moving   |  moving   |  moving   |  86   |
'** |   orange  |   seven   |    bar    |   pear    |  banana   |   cherry  |  v    v
'** +-----------+-----------+-----------+-----------+-----------+-----------+ --------
'**

CONST STILL = 0 '  set up some constants to make meaning of the sprite numbers
CONST MOVING = 1

CONST ORANGE = 1
CONST SEVEN = 2
CONST BAR = 3
CONST PEAR = 4
CONST BANANA = 5
CONST CHERRY = 6

DIM Item%(6, 1) '  this array will hold the sprites from the sprite sheet
DIM SlotSheet% '   this is the actual sprite sheet
DIM SpriteCount% ' a generic counter used to load sprites

SCREEN _NEWIMAGE(640, 480, 32)
CLS
_SCREENMOVE _MIDDLE

SlotSheet% = SPRITESHEETLOAD("slot.png", 74, 86, 0) '        load the sprite sheet containing 74x86 sprites

Item%(ORANGE, STILL) = SPRITENEW(SlotSheet%, 1, DONTSAVE) '  load each sprite into the array manually
Item%(ORANGE, MOVING) = SPRITENEW(SlotSheet%, 7, DONTSAVE)
Item%(SEVEN, STILL) = SPRITENEW(SlotSheet%, 2, DONTSAVE)
Item%(SEVEN, MOVING) = SPRITENEW(SlotSheet%, 8, DONTSAVE)
Item%(BAR, STILL) = SPRITENEW(SlotSheet%, 3, DONTSAVE)
Item%(BAR, MOVING) = SPRITENEW(SlotSheet%, 9, DONTSAVE)
Item%(PEAR, STILL) = SPRITENEW(SlotSheet%, 4, DONTSAVE)
Item%(PEAR, MOVING) = SPRITENEW(SlotSheet%, 10, DONTSAVE)
Item%(BANANA, STILL) = SPRITENEW(SlotSheet%, 5, DONTSAVE)
Item%(BANANA, MOVING) = SPRITENEW(SlotSheet%, 11, DONTSAVE)
Item%(CHERRY, STILL) = SPRITENEW(SlotSheet%, 6, DONTSAVE)
Item%(CHERRY, MOVING) = SPRITENEW(SlotSheet%, 12, DONTSAVE)

'**
'** instead of manually loading each sprite you could have done this as well
'** to achieve the same result:
'**

'FOR SpriteCOunt% = 1 TO 6 '                                                             cycle through number of sprites in each row
'    Item%(SpriteCount%, STILL) = SPRITENEW(SlotSheet%, SpriteCount%, DONTSAVE) '        top row contains the still sprites
'    intem%(SpriteCount%, MOVING) = SPRITENEW(SlotSheet%, SpriteCount% + 6, DONTSAVE) '  bottom row contains the blurred moving sprites
'NEXT SpriteCOunt%

FOR SpriteCount% = 1 TO 6 '                                          cycle through the loaded sprites
    SPRITEPUT SpriteCount% * 100, 100, Item%(SpriteCount%, STILL) '  place the still sprite on the screen
    SPRITEPUT SpriteCount% * 100, 200, Item%(SpriteCount%, MOVING) ' place the moving sprite underneath
NEXT SpriteCount%



'$INCLUDE:'sprite.bi'

https://dl.dropbox.com/u/416997/slot.png  (103KB - the new sprite sheet)

Once you have the sprites loaded simply treat them like any other graphic image using the SPRITEPUT command:

SPRITEPUT x, y, sprite%


LINUXQB64gltester

  • Full Member
  • ***
  • Posts: 241
    • Anyone that likes Art
Re: Ritchie's QB64 Sprite Library (updated V0.2 10/27/12)
« Reply #25 on: April 06, 2013, 08:32:39 am »
 Last night I started trying your " sprite library", with the qb64 GL version,

 All  the "small" demos, like "barrels.bas","collision.bas". "mario.bas",etc, compiled and worked fine,
 I did run into a problem, with the QB64Asteroids,..however, the same problem occured with the SDL version, I am assuming this has worked ok, for others using windows, so I think it is a Linux version, problem,..and I am aware that, when you wrote these, it is intended, for windows qb64,..
 I don't really have windows, on my computer, and have not tried it with the GL version for windows,
I may do that later today, see about installing the GL version, for windows, I do have a windows XP, installed, but there are some problems, I need to fix before I can use it reliably.
 The code in the previous post, and the sprite sheet, "slot.png" seem to work fine, it loads the sprite sheet,....
 I am wondering though, could you
 
Quote
  Once you have the sprites loaded simply treat them like any other graphic image using the SPRITEPUT command:

SPRITEPUT x, y, sprite% 
perhaps explain more on this, or even add the code, that would make it where,  they "spin", for example , when the space key is hit,...as it is it just loads the images,.....there is a lot about this I don't understand, but I think if I could see a sample of how to make them (the sprites) "spin" , it would help...
thanks from Garry
For off topic discussions :
Non-QB64 Related Discussion Forum
Also
My Experimenting Forum
"QB64 has a great future!"

LINUXQB64gltester

  • Full Member
  • ***
  • Posts: 241
    • Anyone that likes Art
Re: Ritchie's QB64 Sprite Library (updated V0.2 10/27/12)
« Reply #26 on: April 06, 2013, 05:10:49 pm »
The "QB64asteroids" did finally compile, and works, with both qb64GL for linux, and also I installed qb64GL to my windows xp partition, the only thing,
 I had to comment these lines,:
Code: [Select]
  ' icon& = _LOADIMAGE("aicon.bmp", 32) '    load the game window icon
'_ICON icon& '    set the icon image
'_FREEIMAGE icon& '  This is line 88   icon image no longer needed
 
  This is cause, .bmp has note yet been implemented,..I think Galleon is going to have that in the next  update though.
For off topic discussions :
Non-QB64 Related Discussion Forum
Also
My Experimenting Forum
"QB64 has a great future!"

Vetea

  • Guest
Re: Ritchie's QB64 Sprite Library (updated V0.2 10/27/12)
« Reply #27 on: August 28, 2013, 03:05:31 am »
Hello Ritchie !!

I use your wonderful Library in my game ( first in QB64 ) Papi commando : http://www.qb64.net/forum/index.php?topic=11346.0

All is ok, but i have some trouble with the commando SPRITEROTATE and the use of a picture with a ALPHA Channel ( or transparent .png ).
Here is a exemple :
http://images3.photomania.com/4567883/1/rad61686.png

You see a diagonal line in the shadow's sprite. I've tried to change my code, your code library but i can't resolve this bug.

if you have a solution ... ;)

Thanks ! :)

Vetea

( Here is the Zip below this post ... )

rezo

  • Newbie
  • *
  • Posts: 30
Re: Ritchie's QB64 Sprite Library (updated V0.2 10/27/12)
« Reply #28 on: September 11, 2013, 06:44:55 pm »
If the library uses maptriangle for rotation, then adding "_Seamless" to the command should fix it. From the wiki:

Quote
_MAPTRIANGLE [_SEAMLESS] (sx1, sy1)-(sx2, sy2)-(sx3, sy3), source& TO (dx1, dy1)-(dx2, dy2)-(dx3, dy3)[, destination&]

The _SEAMLESS option makes the triangle skip the right-most and bottom-most pixels of the triangle. When you make larger objects using several triangles, there can be a "seam" where they overlap when using alpha transparency and the seam would be twice as bright!

Vetea

  • Guest
Re: Ritchie's QB64 Sprite Library (updated V0.2 10/27/12)
« Reply #29 on: September 11, 2013, 08:04:55 pm »
Thanks a lot Rezo !  ;D ;)