[cairo] Overlay problem for two texts

Eric Feillant eric.feillant at live-media.fr
Wed Jan 5 16:44:57 UTC 2022


Thanks Mohit,

Still no success. There's a mistake in my program because if i 
substitute the var joueur1 with a static fixed text :
cairo_move_to(cr, 10, 50);
cairo_show_text(cr, "MY_TEST_TEXT");

Nothing is displayed in the image .

Something wrong i the loop but i don't know where.

I also have inserted something to trace the program:
cairo_move_to(cr, 10, 50);
system("/usr/bin/touch ./AM_I_EXECUTED?");
cairo_show_text(cr, "MY_TEST_TEXT");

The file ./AM_I_EXECUTED is created .....

No idea.

eric

Le 05/01/2022 à 17:18, Mohit Sindhwani a écrit :
> On 2022-1-6 12:10 am, Eric Feillant wrote:
>> Hi Mohit,
>>
>> Thank you for your response.
>>
>> Yes, the code run in a loop for all players. I've tried without :
>> cairo_set_source_rgb(cr, 0.7, 0.3, 0.2);
>> cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
>> cairo_paint(cr);
>>
>> But without success, only player 2 is present in the image ... really 
>> i don't understand
>> because the two player are displayed on screen with the printf 
>> function ....
>>
>
> Are you able to post the images? I think the group doesn't allow 
> pictures but you can try or upload some place and link it.
>
> cairo_set_source_rgb(cr, 0.7, 0.3, 0.2);
> cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
> cairo_paint(cr);
>
> In short, this code sets the colour to rgb(0.7, 0.3, 0.3) and then 
> seems to paint the whole surface in that colour. So, if you did:
> - paint the whole surface in a colour
> - draw the text for player 1
> - paint the whole surface in a colour [again]
> - draw the text for player 2
>
> But if you have removed it and you're still not seeing both texts, 
> something else is going on.
>
> Best Regards,
> Mohit.
> 2022-1-6 | 12:16 am.
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cairographics.org/archives/cairo/attachments/20220105/ef6b25e2/attachment.htm>


More information about the cairo mailing list