https://linen.dev logo
Join Discord
Powered by
# ceramic
  • f

    faint-toothbrush-51643

    02/27/2023, 12:44 AM
    it is actually just its path and name within the assets folder
  • f

    faint-toothbrush-51643

    02/27/2023, 12:44 AM
    but without the file extension
  • f

    faint-toothbrush-51643

    02/27/2023, 12:45 AM
    Copy code
    hx
            app.assets.addText("text:lang/"+selected);
  • f

    faint-toothbrush-51643

    02/27/2023, 12:45 AM
    that's the line i use to load the currently selected language
  • a

    ambitious-knife-25690

    02/27/2023, 12:54 AM
    i'm close 😄
  • a

    ambitious-knife-25690

    02/27/2023, 12:54 AM
    this white square is the ceramic logo
  • a

    ambitious-knife-25690

    02/27/2023, 12:55 AM
    i'm just not sure why its the ceramic logo lol
  • f

    faint-toothbrush-51643

    02/27/2023, 1:03 AM
    you might not have it loaded properly
  • a

    ambitious-knife-25690

    02/27/2023, 1:04 AM
    Copy code
    hx
                      asset.load();
                    asset.onceComplete(null, function(suc) {
                        trace('loaded $suc');
                        callback({
                            data: asset.texture,
                            width: Std.int(asset.texture.width),
                            height: Std.int(asset.texture.height)
                        });
                    });
  • a

    ambitious-knife-25690

    02/27/2023, 1:04 AM
    would this be incorrect?
  • a

    ambitious-knife-25690

    02/27/2023, 1:06 AM
    the texture isn't empty
  • a

    ambitious-knife-25690

    02/27/2023, 1:08 AM
    it is defo loaded
  • f

    faint-toothbrush-51643

    02/27/2023, 1:12 AM
    oh you're loading it as standalone?
  • f

    faint-toothbrush-51643

    02/27/2023, 1:12 AM
    does it do the trace?
  • a

    ambitious-knife-25690

    02/27/2023, 1:13 AM
    well, oddly enough i get a trace saying it was loaded (output from
    ImageAsset
    ) but texture is empty when i tried to read it
  • a

    ambitious-knife-25690

    02/27/2023, 1:13 AM
    so I manually loaded it and it traces as true
  • f

    faint-toothbrush-51643

    02/27/2023, 1:13 AM
    how were you trying to load it before
  • a

    ambitious-knife-25690

    02/27/2023, 1:13 AM
    but it seems like it is being loaded twice now
  • a

    ambitious-knife-25690

    02/27/2023, 1:14 AM
    Copy code
    hx
        override function preload() {
            // Add any asset you want to load here
    
            assets.add(Images.CERAMIC);
        }
  • f

    faint-toothbrush-51643

    02/27/2023, 1:14 AM
    that should be fine
  • f

    faint-toothbrush-51643

    02/27/2023, 1:15 AM
    and then you're accessing it with
    Copy code
    hx
    assets.texture(Images.CERAMIC);
    right?
  • a

    ambitious-knife-25690

    02/27/2023, 1:18 AM
    I'm not, but, I have the texture loaded
  • a

    ambitious-knife-25690

    02/27/2023, 1:18 AM
    Copy code
    hx
            var asset = ceramic.App.app.scenes.main.assets.imageAsset('ceramic');
            
            trace(assets);
            if (asset != null) {
                    asset.load();
                    asset.onceComplete(null, function(suc) {
                        trace('loaded $suc');
                        callback({
                            data: asset.texture,
                            width: Std.int(asset.texture.width),
                            height: Std.int(asset.texture.height)
                        });
                    });
                     }
  • a

    ambitious-knife-25690

    02/27/2023, 1:18 AM
    after the load, asset.texture is no longer null
  • a

    ambitious-knife-25690

    02/27/2023, 1:19 AM
    not sure why i have to load it twice but it does get loaded
  • a

    ambitious-knife-25690

    02/27/2023, 1:20 AM
    if i try to access it through the
    texture
    api i can't seem to figure out the id and if i use the id i get with the above method i still get
    null
  • a

    ambitious-knife-25690

    02/27/2023, 1:20 AM
    so either i'm using the right id and it isn't actually loading or it's the wrong id
  • f

    faint-toothbrush-51643

    02/27/2023, 1:21 AM
    i really don't understand what you're trying to do here, other than avoid using the helpful and simple asset-related functions ceramic provides you
  • a

    ambitious-knife-25690

    02/27/2023, 1:22 AM
    haxeui-ceramic backend
  • a

    ambitious-knife-25690

    02/27/2023, 1:23 AM
    you can't use that api through haxeui
1...787980...124Latest