Compare commits
No commits in common. "main" and "feature-fonts" have entirely different histories.
main
...
feature-fo
@ -4,9 +4,9 @@ extern float blockSize;
|
||||
// hash-функция для шума по целочисленным координатам блока
|
||||
float hash(vec2 p) {
|
||||
p = vec2(
|
||||
dot(p, vec2(127.1, 311.7)),
|
||||
dot(p, vec2(269.5, 183.3))
|
||||
);
|
||||
dot(p, vec2(127.1, 311.7)),
|
||||
dot(p, vec2(269.5, 183.3))
|
||||
);
|
||||
return fract(sin(p.x + p.y) * 43758.5453123);
|
||||
}
|
||||
|
||||
|
||||
@ -10,8 +10,8 @@ vec4 effect(vec4 color, Image tex, vec2 uv, vec2 px)
|
||||
{
|
||||
vec2 cell = floor(px / 2.0); // тут можно размер зерна менять
|
||||
|
||||
float n = hash(cell).x; // 0..1
|
||||
float v = 0.9 + n * 0.1; // 0.9..1.0
|
||||
float n = hash(cell).x; // 0..1
|
||||
float v = 0.9 + n * 0.1; // 0.9..1.0
|
||||
|
||||
return vec4(v, v, v, 1.0);
|
||||
}
|
||||
|
||||
@ -17,7 +17,7 @@ local camera = {
|
||||
velocity = Vec3 {},
|
||||
acceleration = 0.2,
|
||||
speed = 5,
|
||||
pixelsPerMeter = 32,
|
||||
pixelsPerMeter = 24,
|
||||
}
|
||||
|
||||
function camera:getDefaultScale()
|
||||
|
||||
@ -57,10 +57,10 @@ function barElement:draw()
|
||||
love.graphics.setColor(1, 1, 1)
|
||||
--- текст поверх
|
||||
if self.drawText then
|
||||
local font = Tree.fonts:getDefaultTheme():getVariant("medium")
|
||||
local t = love.graphics.newText(font, tostring(self.value) .. "/" .. tostring(self.maxValue))
|
||||
love.graphics.draw(t, math.floor(self.bounds.x + self.bounds.width / 2 - t:getWidth() / 2),
|
||||
math.floor(self.bounds.y + self.bounds.height / 2 - t:getHeight() / 2))
|
||||
local font = Tree.fonts:getDefaultTheme():getVariant("small")
|
||||
love.graphics.setFont(font)
|
||||
love.graphics.printf(tostring(self.value) .. "/" .. tostring(self.maxValue), self.bounds.x,
|
||||
self.bounds.y, self.bounds.width, "center")
|
||||
end
|
||||
|
||||
self:drawBorder("inner")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user