Results 1 to 10 of 10

Thread: TBGL_LoadTexturesFromTiles

  1. #1
    thinBasic MVPs
    Join Date
    May 2007
    Location
    UK
    Posts
    1,427
    Rep Power
    160

    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
    Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
    Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
    Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
    Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370

  2. #2
    thinBasic MVPs Michael Hartlef's Avatar
    Join Date
    Sep 2006
    Location
    Germany
    Age
    59
    Posts
    3,300
    Rep Power
    349

    Re: TBGL_LoadTexturesFromTiles

    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?

  3. #3
    thinBasic MVPs
    Join Date
    May 2007
    Location
    UK
    Posts
    1,427
    Rep Power
    160

    Re: TBGL_LoadTexturesFromTiles

    Sorry Mike but Petr's already done it and I was just giving feed back and comment.
    Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
    Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
    Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
    Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370

  4. #4
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,157
    Rep Power
    736

    Re: TBGL_LoadTexturesFromTiles

    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


    Petr

    P.S. This function is general purpose, but I think for sprites you will love MikesHartlef new system
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  5. #5
    thinBasic MVPs
    Join Date
    May 2007
    Location
    UK
    Posts
    1,427
    Rep Power
    160

    Re: TBGL_LoadTexturesFromTiles

    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
    Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
    Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
    Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
    Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370

  6. #6
    thinBasic MVPs Michael Hartlef's Avatar
    Join Date
    Sep 2006
    Location
    Germany
    Age
    59
    Posts
    3,300
    Rep Power
    349

    Re: TBGL_LoadTexturesFromTiles

    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?

  7. #7
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,157
    Rep Power
    736

    Re: TBGL_LoadTexturesFromTiles

    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

    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  8. #8
    thinBasic MVPs Michael Hartlef's Avatar
    Join Date
    Sep 2006
    Location
    Germany
    Age
    59
    Posts
    3,300
    Rep Power
    349

    Re: TBGL_LoadTexturesFromTiles

    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.
    Attached Files Attached Files

  9. #9
    thinBasic MVPs
    Join Date
    May 2007
    Location
    UK
    Posts
    1,427
    Rep Power
    160

    Re: TBGL_LoadTexturesFromTiles

    Thanks Mike, I will test it tomorrow when I have time.
    Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
    Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
    Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
    Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370

  10. #10
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,157
    Rep Power
    736

    Re: TBGL_LoadTexturesFromTiles

    Requested functionality developed and present in ThinBASIC 1.7.8.0 BETA and newer.
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •