TBGL_LoadTexturesFromTiles
issueid=74 14-06-2009 10:28
thinBasic MVPs
Number of reported issues by Michael Clease: 38
TBGL_LoadTexturesFromTiles

I dont know where my original request was so I thought it better to make a new one ;)

First off thanks Petr seems to work 98%, wheres the other 2% gone you may ask well I think keywords look better with braces. ;)

I think its easier to see where parameters are being passed, so can I have some...please.

thanks


Mike
Issue Details
Issue Number 74
Issue Type Feature
Project TBGL
Category Unknown
Status Implemented
Priority Unknown
Suggested Version Unknown
Implemented Version (none)
Votes for this feature 0
Votes against this feature 0
Assigned Users (none)
Tags (none)




14-06-2009 10:37
Super Moderator
Quote Originally Posted by Michael Clease
I dont know where my original request was so I thought it better to make a new one ;)

First off thanks Petr seems to work 98%, wheres the other 2% gone you may ask well I think keywords look better with braces. ;)

I think its easier to see where parameters are being passed, so can I have some...please.

thanks


Mike
Hi Michael,

it was in your TBGL_EntitySetTexture request. As this is similar to how I load animated sprites, It should be easy to implement.

Just to confirm, basically you want be able to create separate small textures from one big texture file, right?

14-06-2009 10:39
thinBasic MVPs
Sorry Mike but Petr's already done it and I was just giving feed back and comment.

14-06-2009 10:40
Super Moderator
Hi Michael,

yes, you are right.

But you can use both forms now:
[code=thinbasic]
' -- Dirty
TBGL_LoadTexturesFromTiles "Test.bmp", 1, 4, 2, %TBGL_TEX_NEAREST

' -- Neat
TBGL_LoadTexturesFromTiles ("Test.bmp", 1, 4, 2, %TBGL_TEX_NEAREST)
[/code]

ThinCore parsing functions are done in way this is accepted.

For future, I will not create any new functions without braces :occasion:


Petr

P.S. This function is general purpose, but I think for sprites you will love MikesHartlef new system

14-06-2009 10:48
thinBasic MVPs
I suppose we could take this one stage further and join the sprites with tiles

n = TBGL_SpriteSheetLoad ( fileName, numberOfColumns, numberOfRows, [, TransparentColor ]

returns n an array with the sprite handle in.


but thats up to you Mike, I will let you decide.

thanks

Guys

14-06-2009 10:52
Super Moderator
Quote Originally Posted by Michael Clease
I suppose we could take this one stage further and join the sprites with tiles

n = TBGL_SpriteSheetLoad ( fileName, numberOfColumns, numberOfRows, [, TransparentColor ]

returns n an array with the sprite handle in.


but thats up to you Mike, I will let you decide.

thanks

Guys

Sounds good. Now a question to the module masters here on the board. How do I return an array from a module?

14-06-2009 10:58
Super Moderator
I think you can recognize, redim and manipulate array passed byref using thinBasic_Array* core functions.

Other option would be to return string of MKDWD$(handle1)+MKDWD$(handle2)+... and dim the array of DWORDs at the return value ( similar to return custom data from entities ).

I think the first option is more natural, less hack in this case :)


Petr

14-06-2009 21:42
Super Moderator
Quote Originally Posted by Michael Clease
I suppose we could take this one stage further and join the sprites with tiles

n = TBGL_SpriteSheetLoad ( fileName, numberOfColumns, numberOfRows, [, TransparentColor ]

returns n an array with the sprite handle in.


but thats up to you Mike, I will let you decide.

thanks

Guys
Hi Michael

next release will have these commands:

[code=thinbasic]

DIM sprCount AS LONG
DIM spriteArray() AS LONG

sprCount = TBGL_SpriteLoadSheet( filename , tilewidth , tileHeight , spriteArray [, TransparentColor] )

sprCount = TBGL_SpriteCreateSheet( filename , tilewidth , tileHeight , spriteArray [, TransparentColor] )

[/code]

Is that ok with you?

Michael

pS.: I attached the changes TBGL module and a sample script so you can play with it.

14-06-2009 23:38
thinBasic MVPs
Thanks Mike, I will test it tomorrow when I have time.

25-07-2009 11:14
Super Moderator
Requested functionality developed and present in ThinBASIC 1.7.8.0 BETA and newer.

+ Reply