Request: Add Shadow(offset) for luatext option #1212


  • Enhancment
Open
  • transitbus created this issue Aug 2, 2017

    You already have Outline and ThickOutline but how about Shadow()?

     

    Here is my suggested addition to Lua Text:

     

    local function Shadow(offset)
    	local font_string = ScriptEnv.font_string
    	font_string:SetShadowColor(0,0,0,1)
    	if type(offset) == "number" and offset > 0 then
    		font_string:SetShadowOffset(math.abs(offset),(math.abs(offset) * -1))
    	else
    		font_string:SetShadowOffset(1,-1)
    	end
    end
    ScriptEnv.Shadow = Shadow

     

    Now I have  the offset Y to always be negative (possible pointless added safety check to make sure user doesn't put in a negative number by accident) as well as the offset X to always be positive (same reason if a user puts a negative number). If the user puts in no number it should default to a shadow offset of 1 and if the user puts in 0 it also should default to 1

     

    I don't have any user input option for the SetShadowColor settings to keep it looking like a shadow and clean.

     

    To use this would be the same as using Outline in a luatext

     

    Shadow(2) would set a shadow with an offset of 2 for x and -2 for y

     

    Blown up and lightened to make it readable example using Shadow(2) on name, health, power, and class lua texts

     

     

    Here is what Shadow() (which is an offset of 1) looks like

     

  • transitbus added a tag Enhancment Aug 2, 2017
  • transitbus posted a comment Aug 2, 2017

    Oh and while font_string:SetShadowColor(0,0,0,1) can technically be omitted, doing so makes the shadow far too dark. Adding that it gives it a nice shadow effect instead of a harder near black color.

     

    I also did not put options for individual control over the x and y offset because it just looks odd if you don't have them uniform (at least to me, could add that easily).


    Edited Aug 3, 2017
  • transitbus edited description Aug 2, 2017
  • transitbus edited title and description Aug 2, 2017
  • transitbus edited description Aug 3, 2017

To post a comment, please login or register a new account.