Skip to content

Commit d1adaa4

Browse files
committed
damn tabs
1 parent 0a3ee74 commit d1adaa4

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
load_library 'hype'
2+
3+
java_import 'hype.extended.colorist.HPixelColorist'
4+
java_import 'hype.extended.layout.HGridLayout'
5+
include_package 'hype'
6+
7+
CELL_SIZE = 25
8+
9+
def settings
10+
size(618, 482)
11+
end
12+
13+
def setup
14+
sketch_title 'Colorist'
15+
H.init(self)
16+
H.background(color('#242424'))
17+
18+
colors = HPixelColorist.new(data_path('phil_pai.jpg'))
19+
.fill_only
20+
# .strokeOnly
21+
# .fillAndStroke
22+
pool = HDrawablePool.new(576)
23+
pool.autoAddToStage
24+
.add(HRect.new.rounding(4))
25+
.layout(
26+
HGridLayout.new
27+
.start_x(21)
28+
.start_y(21)
29+
.spacing(CELL_SIZE + 1, CELL_SIZE + 1)
30+
.cols(24)
31+
)
32+
.on_create do |obj|
33+
obj.no_stroke.anchor_at(H::CENTER).size(CELL_SIZE)
34+
colors.applyColor(obj)
35+
end.request_all
36+
H.draw_stage
37+
no_loop
38+
end
15.6 KB
Loading

0 commit comments

Comments
 (0)