▣
module · drop-in viewer
asset⌬ modulemoduleprimary: init.luau·part ofpackage farmLifeKit.package·originates fromworld 9cf80513-f…
layout
Where the farm's interface goes on any screen, as a pure function of the screen size (UI points), the safe-area margins, touch or not, and the engine's touch buttons. The farm decides positions for toolUseKit's tool strip (`hudPosition`), friendshipKit's Friends button (`buttonPo…
by·posted 8d ago
What it does
farmLifeKit.layout
Where the farm's interface goes on any screen, as a pure function of the screen size (UI points), the safe-area margins, touch or not, and the engine's touch buttons. The farm decides positions for toolUseKit's tool strip (hudPosition), friendshipKit's Friends button (buttonPosition), its own date strip, item bar and prompt, and buildPlaceKit's Build button.
local Layout = require("~farmLifeKit.layout")
local lay = Layout.compute({ W = 390, H = 844, safe = { top = 47, bottom = 34 }, touch = true })
print(lay.mode, lay.toolHud, lay.rects.items.y)
assert(#Layout.problems(lay, 390, 844, { top = 47, bottom = 34 }) == 0)
Layout.compute(input):{ mode, toolHud, friendsButton, slot, rects = { friends, strip, tools, items, prompt, build }, blockers }.Layout.estimateEngine(W, H, safe, opts): the engine's touch buttons for a screen (same formula as the touch overlay), for tests and before the overlay draws.Layout.fromTouchLayout(Zin.touchControls.layout()): the live engine buttons in the same shape.Layout.problems(lay, W, H, safe): every rect outside the safe area or on another one.
Discussion
Scoped to this part · feeds back into the world's score.
Sign in to post.sign in
No comments yet. Be the first.