Skip to content

Commit

Permalink
Merge pull request #30 from JaThePlayer/patch-2
Browse files Browse the repository at this point in the history
Use `drawableText` for Comments
  • Loading branch information
maddie480 authored Nov 6, 2024
2 parents 4e926d1 + 567bf36 commit 8a0be41
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions Loenn/entities/comment.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
local drawableSprite = require("structs.drawable_sprite")
local drawableFunction = require("structs.drawable_function")
local drawing = require("utils.drawing")
local drawableText = require("structs.drawable_text")
local utils = require("utils")

local comment = {}
Expand Down Expand Up @@ -33,13 +32,7 @@ end
function comment.sprite(room, entity)
if entity.displayOnMap and entity.comment ~= "" then
-- write the comment on the map
local font = love.graphics.getFont()
return drawableFunction.fromFunction(function()
drawing.callKeepOriginalColor(function()
love.graphics.setColor(getTextColor(entity))
drawing.printCenteredText(entity.comment, entity.x, entity.y, entity.width, entity.height, font, 1)
end)
end)
return drawableText.fromText(entity.comment, entity.x, entity.y, entity.width, entity.height, nil, 1, getTextColor(entity))
else
-- render a comment bubble sprite instead
return drawableSprite.fromTexture("ahorn/MaxHelpingHand/comment", entity)
Expand Down

0 comments on commit 8a0be41

Please sign in to comment.