raylib-aseprite icon indicating copy to clipboard operation
raylib-aseprite copied to clipboard

Black Doesn't Render

Open wwderw opened this issue 1 year ago • 7 comments

If I use 0,0,0,255 as a color it doesn't actually render on screen. I change it to a very dark gray and it renders just fine. It may be an issue within the Cute portion, I dunno.

Using this with the latest Raylib 5.5 dev, with the Linux build using Angle as the renderer.

wwderw avatar Oct 21 '24 01:10 wwderw

Have some sample code?

RobLoach avatar Oct 21 '24 02:10 RobLoach

My main.c file contents, this was just a test on getting it to draw, nothing serious on this, more for testing:

#include "../include/raylib.h"
#define RAYLIB_ASEPRITE_IMPLEMENTATION
#include "../include/raylib-aseprite.h"

#include "include/lantern.h"



int main(void){

   const int width = 800;
   const int height = 600;
   SetConfigFlags(FLAG_WINDOW_RESIZABLE | FLAG_WINDOW_HIGHDPI);
   InitWindow(width,height, "");

   Aseprite lantern = LoadAsepriteFromMemory(lantern_aseprite, lantern_aseprite_len);
   AsepriteTag flame = LoadAsepriteTag(lantern, "flame");
                       flame.speed = 1;

   InitAudioDevice();


   SetTargetFPS(60);

   while(!WindowShouldClose()){

         UpdateAsepriteTag(&flame);

         BeginDrawing();
         ClearBackground(WHITE);


         DrawAsepriteTag(flame, 200,200, WHITE);

         EndDrawing();
   }


   UnloadAseprite(lantern);


   CloseAudioDevice();
   CloseWindow();

}

wwderw avatar Oct 21 '24 02:10 wwderw

Do the example demos work? Anything appear in the logs? Very strange.

RobLoach avatar Oct 21 '24 05:10 RobLoach

Just tested again, and it's certainly rendering here. I just drew a bunch of black on top of George.

RobLoach avatar Mar 01 '25 19:03 RobLoach

For me, I just get as close as I can to pure black and that seems to work for me. At my age (C is younger), that's good enough for my eyes.

wwderw avatar Mar 02 '25 01:03 wwderw

Could it be that black is set as the alpha mask in aseptitr or something?

RobLoach avatar Mar 02 '25 07:03 RobLoach

I finally was able to get back to this and apparently it didn't just affect black, but whatever was at idx-0 in whatever palette was used. In the case of your "george" file, idx-0 was a transparency. That's why it worked.

I was creating an opening splash for a weekend game jam and I was using a gameboy palette and the lightest color actually wasn't rendering, the only thing in common that they had with the palette that I normally used was black and the Game Boy color in question was at idx-0. I added a throwaway color the the current palette at idx-0 and re-compiled it and voila it worked.

wwderw avatar Oct 10 '25 21:10 wwderw