Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ Miniwindows
➜ text on transparent window
|
text on transparent window
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Retnur
(9 posts) Bio
|
| Date
| Fri 19 Nov 2010 11:35 PM (UTC) |
| Message
| I'm drawing text on a transparent layer. Because of blending with the color that's transparent the text looks a little off. Ie not solid color and doesn't blend well with the layer below the text.
Is there any reasonable solution to this other than drawing the text on lower layers or using a small background color? | | Top |
|
| Posted by
| Twisol
USA (2,257 posts) Bio
|
| Date
| Reply #1 on Fri 19 Nov 2010 11:53 PM (UTC) Amended on Fri 19 Nov 2010 11:54 PM (UTC) by Twisol
|
| Message
| Could you post an image and/or code? It's a little difficult to visualize the problem from just what you've said.
May as well try a shot in the dark, though... Maybe you could try creating a fade mask according to the technique(s) described in this thread: http://www.gammon.com.au/forum/?id=10530 |
'Soludra' on Achaea
Blog: http://jonathan.com/
GitHub: http://github.com/Twisol | | Top |
|
| Posted by
| Retnur
(9 posts) Bio
|
| Date
| Reply #2 on Sat 20 Nov 2010 04:29 AM (UTC) |
| Message
| | http://www.flickr.com/photos/56084432@N05/5191277774/ | | Top |
|
| Posted by
| Nick Gammon
Australia (23,165 posts) Bio
Forum Administrator |
| Date
| Reply #3 on Sat 20 Nov 2010 05:41 AM (UTC) |
| Message
| I presume you are talking about the word "priest" or "test" or whatever it is in the middle?
How are you drawing it? Just straight text onto the window? |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Retnur
(9 posts) Bio
|
| Date
| Reply #4 on Sat 20 Nov 2010 06:08 AM (UTC) |
| Message
| | I have a transparent flagged window on top of the other layers for text. I'm using WindowText() on that layer. For various reasons I can't draw reliably on the layers under that. Yet I want the text legible. Is there any solution for this? | | Top |
|
| Posted by
| Twisol
USA (2,257 posts) Bio
|
| Date
| Reply #5 on Sat 20 Nov 2010 06:55 AM (UTC) |
| Message
| | Have you tried a dropshadow? Also, try applying a weak fade mask to the area right behind the text before you draw it. |
'Soludra' on Achaea
Blog: http://jonathan.com/
GitHub: http://github.com/Twisol | | Top |
|
| Posted by
| Nick Gammon
Australia (23,165 posts) Bio
Forum Administrator |
| Date
| Reply #6 on Sat 20 Nov 2010 06:58 AM (UTC) |
| Message
| There is always a solution. However it may involve trade-offs. Speed. Memory. Complexity. Visibility. Coding time.
Drawing text on a busy background is always going to be a challenge. Personally I wouldn't have a transparent window on top of another one, I think that just adds a layer of complexity. For one thing, what if you want to move it? Also, the transparency is either on or off, giving you a sharp edge.
One approach would be to "punch out" the background, perhaps by drawing the text in white over the background, perhaps offset one pixel up and left, and then one pixel down and right. Then draw the black text on top in the middle.
Or, fade the background a bit with a blended in rectangle, lowering the intensity of the background. Or more simply, just block out the background with black, white, gray, yellow or whatever, and draw the text on that.
What could look nice is blending in a soft-edged rectangle onto the main window, giving a black background to the text, but without the hard borders. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
26,425 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top