New elements; Fixes

This commit is contained in:
Nikita Kruglickiy
2021-01-14 12:48:30 +06:00
parent eaf0a90173
commit d4dd889bb5
9 changed files with 231 additions and 100 deletions

View File

@@ -7,11 +7,9 @@ require("/koptilnya/libs/utils.txt")
EShape = class("EShape", Element)
accessorFunc(EShape, "_color", "Color", Color(255, 255, 255))
accessorFunc(EShape, "_hoveredColor", "HoveredColor", Color(150, 150, 150))
function EShape:paint()
local x, y = self:getAbsolutePos()
local w, h = self:getSize()
render.setColor(self:getColor())
function EShape:paint(x, y, w, h)
render.setColor(self:isHovered() and self:getHoveredColor() or self:getColor())
render.drawRectFast(x, y, w, h)
end