Bug report: Dynamic Texture bug

Creating scripts
Post Reply
User avatar
Mike Lorrey
Posts: 222
Joined: Sun Sep 04, 2016 5:40 pm
Has thanked: 53 times
Been thanked: 126 times

Bug report: Dynamic Texture bug

Post by Mike Lorrey » Sun Jan 13, 2019 12:30 am

osSetPenColor as documented allows us to set pen color by a hexadecimal value that includes a two character value for the transparency preceding the six digit hex color value. So 00 = transparent and FF = opaque, such that 00000000 is transparent black and FF000000 is opaque black. However this not the result inworld. The following script code:

string CommandList = ""; // Storage for our drawing commands

CommandList = osSetPenSize( CommandList, 1 ); // Set the pen width to 3 pixels
CommandList = osSetPenColor( CommandList, "00000000" ); // Set the pen color to transparent black
CommandList = osMovePen( CommandList, 0, 0 ); // Upper left corner at <28,78>
CommandList = osDrawFilledRectangle( CommandList, 256, 256 ); // 256x256 pixels
CommandList = osMovePen( CommandList,10,15);
CommandList = osSetPenColor(CommandList, "Red");
CommandList = osSetFontName(CommandList, "Impact");
CommandList = osSetFontSize(CommandList,80);
CommandList = osDrawText(CommandList,SLTclock);
CommandList = osMovePen(CommandList,15,140);
CommandList = osSetFontSize(CommandList,45);
CommandList = osDrawText(CommandList,"GRIDTIME");

// Now draw the rectangle
osSetDynamicTextureDataBlendFace("", "vector", CommandList, "width:256,height:256",FALSE, 2, 0, 255, 0);

Results in an opaque background to the dynamic texture as seen here on the left compared to the one on the right that has a black background that is opaque.
bull and bear_025.png
bull and bear_025.png (238.29 KiB) Viewed 201 times
John Hopkin
Posts: 5
Joined: Tue Feb 04, 2014 9:50 pm
Has thanked: 2 times
Been thanked: 0

Re: Bug report: Dynamic Texture bug

Post by John Hopkin » Sun Jan 13, 2019 4:54 am

What is the Alpha Mode setting on that surface?
User avatar
Mike Lorrey
Posts: 222
Joined: Sun Sep 04, 2016 5:40 pm
Has thanked: 53 times
Been thanked: 126 times

Re: Bug report: Dynamic Texture bug

Post by Mike Lorrey » Tue Jan 15, 2019 11:37 pm

John Hopkin wrote:
Sun Jan 13, 2019 4:54 am
What is the Alpha Mode setting on that surface?
Alpha blending.
Post Reply