Imagens no palco por nome/número, paleta recarregável e slider de zoom
- Core: armazém de imagens nomeadas (tb_image_store_*) e tb_stage_image* para desenhar imagens no palco pelo nome ou pelo número. - Caneta: blocos "desenhe imagem nome/número". - tinyblocks-api: tb_api_load_named/tb_api_find_library e mtime em ns; o editor carrega as libraries de categoria como .so quando existem, para a paleta recarregar ao vivo. - Aba de imagem: slider de zoom no rodapé no lugar dos botões -/+. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2b6bc65062
commit
adf5d2cd12
11 files changed
+378
-32
No files matched your search
@@ -45,6 +45,18 @@ TB_API int tb_image_format_count(void);
|
||||
TB_API TinyBlocks_Image* tb_image_load(const char* path);
|
||||
TB_API bool tb_image_save(const TinyBlocks_Image* img, const char* path);
|
||||
|
||||
/* -- Armazem de imagens nomeadas (usado pelos blocos "desenhe imagem") ----
|
||||
* Uma imagem carregada ganha um NOME (ex: "c0bot" e "c0bot.png") e um NUMERO
|
||||
* (1, 2, 3... na ordem em que entrou). O armazem mantem uma referencia, entao
|
||||
* o palco pode desenhar a imagem depois sem se preocupar com a memoria. */
|
||||
#define TB_IMAGE_STORE_MAX 32
|
||||
TB_API int tb_image_store_put(const char* name, TinyBlocks_Image* img); /* -> numero (1..n) */
|
||||
TB_API TinyBlocks_Image* tb_image_store_get(const char* name); /* nome ou arquivo */
|
||||
TB_API TinyBlocks_Image* tb_image_store_at(int number); /* 1..n (0 = nada) */
|
||||
TB_API int tb_image_store_count(void);
|
||||
TB_API const char* tb_image_store_name(int number);
|
||||
TB_API void tb_image_store_clear(void);
|
||||
|
||||
/* -- Helpers para TinyBlocks_Value --- */
|
||||
TB_API TinyBlocks_Value tb_value_image (TinyBlocks_Image* img); /* retém ref */
|
||||
TB_API TinyBlocks_Image* tb_value_as_image(TinyBlocks_Value v);
|
||||
|
||||
@@ -20,6 +20,12 @@ TB_API void tb_stage_rect(float x, float y, float w, float h);
|
||||
TB_API void tb_stage_circle(float x, float y, float radius);
|
||||
TB_API void tb_stage_text(const char* text, float x, float y);
|
||||
|
||||
/* Imagens: desenha a imagem centrada em (x,y). Pode receber a imagem direto,
|
||||
pelo NOME (ver tb_image_store_put) ou pelo NUMERO (1..n). */
|
||||
TB_API bool tb_stage_image(const TinyBlocks_Image* img, float x, float y);
|
||||
TB_API bool tb_stage_image_named(const char* name, float x, float y);
|
||||
TB_API bool tb_stage_image_number(int number, float x, float y);
|
||||
|
||||
/* Vista: tamanho da area onde o palco sera desenhado (letterbox 4:3) */
|
||||
TB_API void tb_stage_set_view(float w, float h);
|
||||
|
||||
|
||||
Reference in new issue
Block a user