Tiny Thor (made with Monkey X)
Develop on Windows or OSX and deploy easily
Crypt of the Necrodancer (made with Monkey X)
New Star Soccer - BAFTA Winner 2013!!! (made with Monkey X )
Ted - The code editor of Cerberus X
Avalon Legends (made with Monkey X)
Race Time (made with Monkey X)

bgfx module

Ferdi Sep 29, 2018

  1. Ferdi

    Ferdi Member 3rd Party Target Dev

    Messages:
    68
    Likes Received:
    26
    Trophy Points:
    18
    I would love to hear how you would have done this. I am really bad at creating API :confused:
     
  2. MikeHart

    MikeHart Administrator Staff Member Administrator Moderator

    Messages:
    1,231
    Likes Received:
    300
    Trophy Points:
    83
    I would return an id when you load the atlas. This way you have them identifiable and there will be no duplicates when you add this as a parameter to your load image command.
     
  3. dawlane

    dawlane Active Member CX Code Contributor

    Messages:
    385
    Likes Received:
    161
    Trophy Points:
    43
    @Ferdi: What you need to do is read up on game asset management to find a suitable solution to files with the same name.
     
  4. Ferdi

    Ferdi Member 3rd Party Target Dev

    Messages:
    68
    Likes Received:
    26
    Trophy Points:
    18
    *slap forehead* Thanks Mike. I think you better check my code. Make sure I don't do silly things like this.

    @dawlane: I like Mike's solution. I had a look at how LibGDX does it. I did not like it. It returns Stack<AtlasImage>, but it also can return individual AtlasImage.

    So the code now becomes:

    Code (Cerberus X):
    1.  
    2. Local atlasId:Int = LoadAtlas("td_spritesheet.txt")
    3. ' Local atlasId:Int = ATLAS_NULL ' = -1, this is if you want to load individual files
    4.  
    5. destroyerImg = LoadAtlasImage(atlasId, "sprites/Destroyer.png")
    6. ekstraLiveImg = LoadAtlasImage(atlasId, "sprites/EkstraLive.png")
    7. goldImg = LoadAtlasImage(atlasId, "sprites/Gold.png")
    8.  
     
    MikeHart likes this.
  5. Ferdi

    Ferdi Member 3rd Party Target Dev

    Messages:
    68
    Likes Received:
    26
    Trophy Points:
    18
    Example 6 bump texture. I had to load the texture using bimg, and it has conflict with Cerberus because both were using stb_image. It is working, but need to do ALOT of clean up underneath. Anyway source code is attached and screenshot:

    06-bump.png
     

    Attached Files:

  6. MikeHart

    MikeHart Administrator Staff Member Administrator Moderator

    Messages:
    1,231
    Likes Received:
    300
    Trophy Points:
    83
    That looks interesting. Cant wait to play with that target.
     
  7. Ferdi

    Ferdi Member 3rd Party Target Dev

    Messages:
    68
    Likes Received:
    26
    Trophy Points:
    18
    Hi Mike, I'll think of something so others can play with the target.