Fixed textscaling
This commit is contained in:
1 parent
695bf11478
commit
d9fbf53d32
3 files changed
+16
-22
No files matched your search
+4
-4
@@ -224,11 +224,11 @@ function EID:filterMarkup(text, textPosX, textPosY)
|
||||
local textposition = string.find(text, word)
|
||||
local lookup = EID:getIcon(word) or EID.InlineIcons["ERROR"]
|
||||
local Xoffset = lookup[5] or 0
|
||||
local prefixTextWidth = EID:getStrWidth(string.sub(text, 0, textposition - 1))
|
||||
local prefixTextWidth = EID:getStrWidth(string.sub(text, 0, textposition - 1))*EIDConfig["Scale"]
|
||||
EID.InlineIconSprite:SetFrame(lookup[1], lookup[2])
|
||||
EID.InlineIconSprite.Scale = Vector(EIDConfig["Scale"], EIDConfig["Scale"])
|
||||
EID.InlineIconSprite:Render(
|
||||
Vector((textPosX + prefixTextWidth + Xoffset -2) * EIDConfig["Scale"], textPosY),
|
||||
Vector((textPosX + prefixTextWidth + Xoffset -1), textPosY),
|
||||
Vector(0, 0),
|
||||
Vector(0, 0)
|
||||
)
|
||||
@@ -248,10 +248,10 @@ end
|
||||
|
||||
--needs to be called in a render Callback
|
||||
-- args: string, Vector(int, int), Vector(float,float), KColor obj, bool
|
||||
function EID:renderString(str, position, scale, kcolor, centered)
|
||||
function EID:renderString(str, position, scale, kcolor)
|
||||
str = EID:replaceShortMarkupStrings(str)
|
||||
str = EID:filterMarkup(str, position.X, position.Y)
|
||||
EID.font:DrawStringScaledUTF8(str, position.X, position.Y, scale.X, scale.Y, kcolor, EID:getStrWidth(str), centered)
|
||||
EID.font:DrawStringScaledUTF8(str, position.X, position.Y, scale.X, scale.Y, kcolor, 0, false)
|
||||
end
|
||||
|
||||
-- Get KColor object of "Entity Name" texts
|
||||
|
||||
+2
-2
@@ -43,8 +43,8 @@ __eidItemTransformations[2] = "Test"
|
||||
|
||||
local function onDebugRender(t)
|
||||
for i, v in ipairs(charsToDebug) do
|
||||
local pos = Vector(EIDConfig["XPosition"] * EIDConfig["Scale"], EIDConfig["YPosition"] - 15 + ((i - 1) * 14))
|
||||
EID:renderString(v, pos, Vector(EIDConfig["Scale"], EIDConfig["Scale"]), KColor(1, 1, 1, 1, 0, 0, 0), true)
|
||||
local pos = Vector(EIDConfig["XPosition"], EIDConfig["YPosition"] - 15 + ((i - 1) * 14))
|
||||
EID:renderString(v, pos, Vector(EIDConfig["Scale"], EIDConfig["Scale"]), KColor(1, 1, 1, 1, 0, 0, 0))
|
||||
|
||||
if not showDebugChars then
|
||||
break
|
||||
|
||||
@@ -125,10 +125,9 @@ function printDescription(desc)
|
||||
end
|
||||
EID:renderString(
|
||||
desc.Name,
|
||||
Vector(EIDConfig["XPosition"] + offset * EIDConfig["Scale"], padding - 4),
|
||||
Vector(EIDConfig["XPosition"] + offset, padding - 4),
|
||||
Vector(EIDConfig["Scale"], EIDConfig["Scale"]),
|
||||
EID:getNameColor(),
|
||||
false
|
||||
EID:getNameColor()
|
||||
)
|
||||
|
||||
padding = padding + lineHeight * EIDConfig["Scale"]
|
||||
@@ -156,10 +155,9 @@ function printDescription(desc)
|
||||
if EIDConfig["TransformationText"] then
|
||||
EID:renderString(
|
||||
transformationName,
|
||||
Vector(EIDConfig["XPosition"] + (transformSprite[2]+iconOffsetX +3) * EIDConfig["Scale"], padding - 1),
|
||||
Vector(EIDConfig["XPosition"] + (transformSprite[2]+iconOffsetX +3), padding - 1),
|
||||
Vector(EIDConfig["Scale"], EIDConfig["Scale"]),
|
||||
EID:getTransformationColor(),
|
||||
false
|
||||
EID:getTransformationColor()
|
||||
)
|
||||
end
|
||||
if (EIDConfig["TransformationIcons"] or EIDConfig["TransformationText"]) then
|
||||
@@ -178,8 +176,7 @@ function printTrinketDescription(desc, objType)
|
||||
desc.Name,
|
||||
Vector(EIDConfig["XPosition"], padding - 4),
|
||||
Vector(EIDConfig["Scale"], EIDConfig["Scale"]),
|
||||
EID:getNameColor(),
|
||||
false
|
||||
EID:getNameColor()
|
||||
)
|
||||
|
||||
padding = padding + lineHeight * EIDConfig["Scale"]
|
||||
@@ -219,14 +216,13 @@ function printBulletPoints(description, padding)
|
||||
lineToPrint = string.gsub(lineToPrint, bpIcon .. " ", "")
|
||||
end
|
||||
|
||||
EID:renderString(bpIcon, Vector(posX, padding), Vector(EIDConfig["Scale"], EIDConfig["Scale"]), textColor, false)
|
||||
EID:renderString(bpIcon, Vector(posX, padding), Vector(EIDConfig["Scale"], EIDConfig["Scale"]), textColor)
|
||||
end
|
||||
EID:renderString(
|
||||
lineToPrint,
|
||||
Vector(posX + 12 * EIDConfig["Scale"], padding),
|
||||
Vector(posX + 12, padding),
|
||||
Vector(EIDConfig["Scale"], EIDConfig["Scale"]),
|
||||
textColor,
|
||||
false
|
||||
textColor
|
||||
)
|
||||
padding = padding + lineHeight * EIDConfig["Scale"]
|
||||
end
|
||||
@@ -441,8 +437,7 @@ local function onRender(t)
|
||||
EIDConfig["ErrorMessage"],
|
||||
Vector(EIDConfig["XPosition"], posY()),
|
||||
Vector(EIDConfig["Scale"], EIDConfig["Scale"]),
|
||||
EID:getErrorColor(),
|
||||
false
|
||||
EID:getErrorColor()
|
||||
)
|
||||
end
|
||||
else
|
||||
@@ -450,8 +445,7 @@ local function onRender(t)
|
||||
EID:getDescriptionTable("unidentifiedPill"),
|
||||
Vector(EIDConfig["XPosition"], posY()),
|
||||
Vector(EIDConfig["Scale"], EIDConfig["Scale"]),
|
||||
EID:getErrorColor(),
|
||||
false
|
||||
EID:getErrorColor()
|
||||
)
|
||||
end
|
||||
local pillsprite = closest:GetSprite()
|
||||
|
||||
Reference in new issue
Block a user