To see a basic of what effect I created, you can join at byond://70.116.146.138:5000 which showcases a basic outline of the text itself only, I could've done a rectangle, what I did, or just about anything, I can also make it use alpha effects or different shades of colors as it goes further out...

So if one tells me an effect, I can create it & give you the code to make it happen
In response to Superbike32
Superbike32 wrote:
To see a basic of what effect I created, you can join at byond://70.116.146.138:5000 which showcases a basic outline of the text itself only, I could've done a rectangle, what I did, or just about anything, I can also make it use alpha effects or different shades of colors as it goes further out...

So if one tells me an effect, I can create it & give you the code to make it happen

That is really cool. :O

In response to Superbike32
Superbike32 wrote:
To see a basic of what effect I created, you can join at byond://70.116.146.138:5000 which showcases a basic outline of the text itself only, I could've done a rectangle, what I did, or just about anything, I can also make it use alpha effects or different shades of colors as it goes further out...

So if one tells me an effect, I can create it & give you the code to make it happen

It took you two objects to make that effect, if you're using maptext.
FIREking, it indeed does use maptext, also it's one object of maptext as overlay & underlay to apply the effect to the text.

Also this feature request isn't about simply using less objects, or have to code less to get any effects, it's the possibility to add any such effects in the first place, and how to do it.

I'm showing it's already possible to do it now, although a lot harder for people to figure out more than likely, so I am willing to help.

Also, a few people have a hard time figuring out just exactly how to make the maptext for names showing above their head like I do already, so I think it's useful in many different ways than just this...

But if someone wants to use something like this, I will code the effect & give them the code...

However, something like this request will make it easier for people to understand how & do it with less lines of code, and maybe processing as well, considering well, just about anything built in will run faster(even if although only slightly).

---The new object is created, the object has an overlay added to it, maptext, the text effect is added to the object as an underlay, and finally this object is added as an overlay to the mob which the text belongs to & positioned.
... Anyways

maptext should support text-shadow css tags
Bump
Bump - This would very much save me the trouble of having to create and destroy objects to create a "fake" text shadow that, mind you, looks horrible at times. And is very inefficient since it does it for each letter on each of the 4 sides. That's a lot of creating and destroying. Not very healthy.
In response to Xirre
I'm not sure what you mean by "each letter". If you want to create a shadow for maptext, you can use the exact same text. It doesn't have to be done on a per-letter basis, and in fact would be harder that way.

Drawing to a buffer and manipulating pixels might make this doable client-side, though I don't see how that'd work in DirectX code. The webclient would have an easier time of it, but I'm pretty sure it'd have to do all the manipulation manually rather than make use of the browser's built-in text-shadow capability.
It will have to be done for each letter (i.e. "Hello world" would be done in this order; H, He, Hel, Hell...) because I plan on doing a dialog system that prints out characters 1 by 1, sort of like an animation. The only downside to doing this way is the creation and deletion of objects. Which, when done on multiple users, can be taxing.

/*********************
Fonts.dm

// This holds the installed fonts and outlining for text
// manipulation.

*********************/



var/list/font_resources = list('fonts/Futurist.ttf', 'fonts/pkmnrs.ttf', 'Monospace.ttf')

proc
NewText(text, outlineSize = 0, width = 64, height = 32, fontColor = "#FFFFFF", size = 2, face = "Monospace", align = "left", outlineColor = "#000000", layer = UI_LAYER+1, offsetX = 0, offsetY = 0)
if(text)
var/obj/o = new

//Create the maptext
o.layer = layer
o.pixel_x = offsetX
o.pixel_y = offsetY
o.maptext_width = width
o.maptext_height = height
o.maptext = "<font color=[fontColor] align=[align] size=[size] face=\"[face]\">[text]</font>"

//Apply outline
if(outlineSize)
size -= 1
size += outlineSize
o.underlays += list(
MapText(text, align, width, height, outlineColor, size, face, layer, outlineSize, outlineSize),
MapText(text, align, width, height, outlineColor, size, face, layer, outlineSize, -outlineSize),
MapText(text, align, width, height, outlineColor, size, face, layer, -outlineSize, outlineSize),
MapText(text, align, width, height, outlineColor, size, face, layer, -outlineSize, -outlineSize),
MapText(text, align, width, height, outlineColor, size, face, layer, 0, outlineSize),
MapText(text, align, width, height, outlineColor, size, face, layer, 0, -outlineSize),
MapText(text, align, width, height, outlineColor, size, face, layer, outlineSize, 0),
MapText(text, align, width, height, outlineColor, size, face, layer, -outlineSize, 0)
)

return o


MapText(text, align, width, height, fontColor, size, face, layer, offsetX, offsetY)
var/obj/o = new

o.layer = layer
o.pixel_x = offsetX
o.pixel_y = offsetY
o.maptext_width = width
o.maptext_height = height
o.maptext = "<font color=[fontColor] align=[align] size=[size] face=\"[face]\">[text]</font>"
return o

mob
attackable
player
proc
OutlineText(t, screenLoc, _size = 2, _align = "top", _face = "Power Red and Blue")
var/obj/o = NewText("[t]", 1, size = _size, align = _align, face = _face)
o.screen_loc = screenLoc
o.layer = UI_LAYER + 1
client.screen += o
In response to Xirre
My advice is to use something other than overlays for your maptext. I took a day to work on a bordered maptext system of my own for on-screen dialogue, and I found (not to my surprise) that using the overlays list was one of the slower methods, and it didn't have many, if any advantages versus the alternative(s) (in my case, at least). Here's what it came to look like when used for name tags and a dialogue.

The only downside to doing this way is the creation and deletion of objects. Which, when done on multiple users, can be taxing.

It sounds like you're doing something wrong. I also wouldn't use screen_loc for something like maptext (at least not in the manner I see you using it).

I support all notions to update maptext. There aren't many use cases where plain maptext fits comfortably, IMO.
In response to FKI
FKI wrote:
My advice is to use something other than overlays for your maptext. I took a day to work on a bordered maptext system of my own for on-screen dialogue, and I found (not to my surprise) that using the overlays list was one of the slower methods, and it didn't have many, if any advantages versus the alternative(s) (in my case, at least). Here's what it came to look like when used for name tags and a dialogue.

The only downside to doing this way is the creation and deletion of objects. Which, when done on multiple users, can be taxing.

It sounds like you're doing something wrong. I also wouldn't use screen_loc for something like maptext (at least not in the manner I see you using it).

I support all notions to update maptext. There aren't many use cases where plain maptext fits comfortably, IMO.

How did you go about doing yours?
In response to Xirre
I use images, and for a number of reasons. I keep track of the maptext image, or label, and its background. An exoskeleton of the programming:

image/label
layer = 11
var/tmp/handle = ""
var/tmp/border[8]
var/tmp/auto = 0
var/tmp/center = 0

var/tmp/css_class = "label"
var/tmp/border_color = "#000"

var/tmp/initial_px = 0
var/tmp/initial_py = 0

New(icon, loc,state, layer, dir, pixel_x, pixel_y)
..()
initial_px = pixel_x
initial_py = pixel_y

proc/set_handle(text)
handle = text

update_maptext()

proc/show(client/c)
if(!c)
return

if(ismob(c))
c = c:client

c.images.Add(border, src)

proc/hide(client/c)
if(!c)
return

if(ismob(c))
c = c:client

c.images.Remove(border, src)

proc/init_maptext(atom/movable/loc, text, px, py, outline = 1)

update_maptext()

proc/update_maptext()


The label is initiated once through init_maptext, and all of the following manipulation is handled through update_maptext, which is called whenever the text changes. The latter proc applies any soft-centering, updates maptext width/height in some cases, and makes sure the text background is appears correctly.

Granted, you're still going to have the same amount of objects to create the shadow effect, but that's something I wouldn't worry about, especially if you're using images.
Em, seems like this thread got way off track.

Can we get maptext to support standard CSS background-color attributes?

Seems like you cracked the code in 2014 with implementing this stuff, Lum. Would very much like to be able to apply background colors to maptext as determined by the HTML flow itself, and not some globalized hacky workaround.
Page: 1 2 3