ID:39330
 
This post is in response to Mikau's recent post regarding displaying text over the map. In short Mikau failed and everyone there said you can't.

It is possible and I'm not quite sure what I did that Mikau didn't, since his method was nearly the same as what I did.

Here's the demo/source

Not sure when/how my text got white. I don't remember it being white.. >.>
Very cool, I may use this one day.
Just keep in mind that you'd have to do some extra work to reposition the text if they move their game window. Too tired to think of how you could detect changes in the game window's position. As far as I know BYOND doesn't support any form of event listeners that could catch window movement.
You didn't do anything I did. I didn't do anything on the coding end save for a standard say() verb that would output whatever you said to the world in an output window.

I attempted to use the default output that BYOND uses in a transparent pane, and to hover the child of that pane over the map.
This is a pretty hot breakthrough. I'm glad you made this. :)
@Mikau
Not like I could actually see your implementation. I was speaking of the transparent window idea though. I'll check yours out though, sounds like it's better than mine :P.

@Tayoko
Mikau's is definitely just as cool except he doesn't let us see the magic behind it :(.

I tried this, too. It works pretty well but I found on light backgrounds/maps with white text, you'd lose some of the text (it'd blend in). Vice versa with dark backgrounds and black text. I was attempting to have two output windows (one white text and, under that and using the same words, one with black text just about 1 or 2 pixels down and right) that could've made shadowed text (readable against either background), but the white output window 'hid' the black one (but still allowed the map to show through). If you can think of a way to get that working, lemme know.

PS. don't forget you can mov the position of the windows as well, so, theoretically, you could have the text positioned over a mob (like dialouge), if you can convert byond coords to screen coords.
Well, the way to fix the background versus text problem is to just change the default text color in those areas. The way I implemented it allows you to have different colors of text using simple hexadecimal rgb codes.

I don't think it would be too hard to convert BYOND coords to screen coords as long as you can make sure that the game window doesn't get moved--either that or you have to constantly redetect/reset the game window's position. I tried maximizing the window and turning off resize but clicking the background lets you slide the window around.

If you would have looked at the implementation, you would've seen that I know that you can move the windows' positions. I make a bunch of clones of a single pane-like window for the text queue and reposition them.
Vermolius wrote:
Well, the way to fix the background versus text problem is to just change the default text color in those areas.

Um, that's fine and good if you can constantly get the color(s) of the tile
the text is over. Seems like a lot of overhead to me. But, yeah, I'm aware that you can change the color of an output control.

Shadowed or outlined text is just a common way of making letters readable in a tranparent window. A lot of apps use it and it works well against most backgrounds without having to reset the color constantly.

If you would have looked at the implementation...

Well, I did look at the implementation. My PS. was more about getting the idea of dialougue windows that hover over a mob (kind of like Lummox's DMIFonts speech bubbles) out there and into the public more than trying to school anybody on winset pos.

Shadowed or outlined text is just a common way of making letters readable in a tranparent window. A lot of apps use it and it works well against most backgrounds without having to reset the color constantly.

I didn't really mean that you would check the turfs colors constantly but rather design your maps in such a way that you could alter the default text color in those areas so that the text wouldn't blend in. I'll see if I can't rig up a text shadow to go with it, though.

Well, I did look at the implementation. ... more than trying to school anybody on winset pos.

Sorry for taking it that way, I'm just used to the stereotypical BYOND member who trash talks everyone acting superior and such.


Brilliant :)
How much overhead does that cause?
Vermolius wrote:
I'll see if I can't rig up a text shadow to go with it, though.

Cool :). I'm glad you two are working on this.

Sorry for taking it that way, I'm just used to the stereotypical BYOND member who trash talks everyone acting superior and such.

No worries at all :). I understand completely.

Mikau wrote:
Give this a try.

Cool. Looks like you got semi-transparency to work. I was worried Nadrew had successfully headshotted hope in the Developer Forum, but looks like he missed.
TheMonkeyDidIt wrote:
Cool. Looks like you got semi-transparency to work. I was worried Nadrew had successfully headshotted hope in the Developer Forum, but looks like he missed.

I didn't get it to work, right now I'm using one window for the input/output, and another window of the exact same size without anything on it. Just a semi-black background.

What I want is for us to be able to control all of that within' the output control itself, that way we don't have to have 2 seperate windows hovering over the screen. We can have the chat in the main window, and we don't have to worry about moving around windows and what's going to happen to them.
Mikau wrote:
I didn't get it to work, right now I'm using one window for the input/output, and another window of the exact same size without anything on it.

Ah, yeah. Now I see what you mean. Good try with the auto reset on move, tho.

The best I can offer is two hacks (the second of which might get you close):

1.) A 50% dither on the image used as the bacground for the output. Basically every other pixel is the mask color (the color you're setting to transparent) and the next black (or something similar). This'll allow every other pixel of the map to show through and be dark on the rest. It doesn't look all that bad, but doesn't look all that great either.

2.) (Maybe closer) Make an object with an icon that is a 32x32 black rectangle but with an alpha value of 128. Add that obj to the client.screen with a screen_loc that covers the section you want darkened (something like: "1,1 to 21,6" ). Now put the transparent output over the map section that (you believe) is covered by that screen obj. This would take some trial and error, I think, because there's no way to preview the map. If you align them well, and anchor them properly (something I suck at), then it may work. I dunno.

Just some thoughts.

I agree with you though, with the larger map sizes possible now, semi-transparent and properly transparent output would be really nice.
Well if I was going to use screen objects, I wouldn't have to use the output at all, since you can easily write to the screen.

The idea is to avoid the screen objects.
Mikau wrote:
The idea is to avoid the screen objects.

Ok. I was assuming you were looking for something that was formattable and low overhead (like the output control). Fair enough.