Custom Text Formatting (Previously: Getting long results in a program)
|
04-11-2024, 06:22 AM
Post: #61
|
|||
|
|||
RE: Getting long results in Program
No....
I think your thinking is much more complicated than my algorithm Please analyze my algorithm step by step, and you will understand that it is much simpler than you think. The approach I propose requires the use of TEXTOUT_P only once (possibly a second time when bolding is applied). The frame also does not have to be drawn at an angle. Where did you get such a crazy idea? The frame in this case is created using RECT_P regardless of whether it will be drawn in the buffer or on Gx. Tilting the background in the opposite direction before applying the text should be done after drawing the frame (according to the order of points in my algorithm), so the frame will also automatically tilt. I assumed that the transparency level is set by a parameter with values from 0 to 255. Let's assume that beneath the text, there's a texture as the background. So, I start by copying it to the buffer. At the moment of creating the entire graphic, I don't use transparency at all. This can be done only when finally transferring the formatted text from the buffer to Gx. Therefore, if I provide a background color, the background in the buffer won't be transparent (it will completely cover the texture). But after copying everything to Gx with a transparency level, the effect of the background blending with the texture will be visible. The second case is when you don't select a background color. In that case, the letters will be drawn directly on the texture in the buffer (also without transparency). When you then transfer everything to Gx, setting the transparency level, the background, because it will be the same, will not change at all (transparency by definition changes the colors only of those pixels that are different between the source and the target, and here the source and the target will be the same). The difference will be only in the letters themselves, so the transparency will affect only them. Piotr Kowalewski |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 64 Guest(s)