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