Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Layer not working ? #71

Open
oscarmh opened this issue May 22, 2022 · 3 comments
Open

Layer not working ? #71

oscarmh opened this issue May 22, 2022 · 3 comments

Comments

@oscarmh
Copy link

oscarmh commented May 22, 2022

Hi team... what is wrong with this ? I cannot see the color... any help is appreciated

setup 1,1536,3;
init;
brightness 1,20;
config_2D 1,96,16,3,16,16;
init_layer 1,1,1,0,1,0;
change_layer 1,1;
draw_image 1,red-green.png;
init_layer 1,2,1,0,1,0;
change_layer 1,2;
text_input 1,0,12,96,12,6666,0,0048BA,,10,12,,,enhanced_led_board-7.ttf

@oscarmh
Copy link
Author

oscarmh commented May 22, 2022

no success, no matter if I do render at the end or in other positions even with chanel signaling.

@tom-2015
Copy link
Owner

Did you try if the text_input command works without background image (like just one layer)?
Maybe try with FFFFFF as text color.

@tom-2015
Copy link
Owner

tom-2015 commented Jun 5, 2022

I had some time today to take a closer look and I found 1 problem: the render operation of layer 2 is probably not correct:

  • use operator 8 (CAIRO_OPERATOR_DEST_IN) if you want the background image to appear where text is
  • use operator 2 (CAIRO_OPERATOR_OVER) if you want the text to be rendered on top of the image

Also make sure the red-green.png is available, normally it is in the examples folder

So this will give:

setup 1,1536,3;
init;
brightness 1,20;
config_2D 1,96,16,3,16,16;
init_layer 1,1,1,0,1,0;
change_layer 1,1;
draw_image 1,"examples/red-green.png";
init_layer 1,2,8,0,1,0;
change_layer 1,2;
text_input 1,0,12,96,12,6666,0,0048BA,,10,12,,,enhanced_led_board-7.ttf

OR

setup 1,1536,3;
init;
brightness 1,20;
config_2D 1,96,16,3,16,16;
init_layer 1,1,1,0,1,0;
change_layer 1,1;
draw_image 1,"examples/red-green.png";
init_layer 1,2,2,0,1,0;
change_layer 1,2;
text_input 1,0,12,96,12,6666,0,0048BA,,10,12,,,enhanced_led_board-7.ttf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants