More progress
This commit is contained in:
40
src/Tools/tim_tool/ui/vram-components.slint
Normal file
40
src/Tools/tim_tool/ui/vram-components.slint
Normal file
@@ -0,0 +1,40 @@
|
||||
component VRAMSegment inherits Rectangle {
|
||||
in property <image> img;
|
||||
in property <int> clip_x;
|
||||
in property <int> clip_y;
|
||||
|
||||
width: 64px;
|
||||
height: 256px;
|
||||
clip: true;
|
||||
Image {
|
||||
source: img;
|
||||
x: -root.clip_x*1px;
|
||||
y: -root.clip_y*1px;
|
||||
}
|
||||
}
|
||||
|
||||
export component VRAMArea inherits Rectangle {
|
||||
in property <image> img;
|
||||
in property <int> img_x;
|
||||
in property <int> img_y;
|
||||
|
||||
width: (64*16+15)*1px;
|
||||
height: (256*2+1)*1px;
|
||||
|
||||
for idx in 32 : VRAMSegment {
|
||||
x: root.get_x(idx)*(64px + 1px);
|
||||
y: root.get_y(idx)*(256px + 1px);
|
||||
|
||||
img: img;
|
||||
clip_x: (root.get_x(idx)*64) - root.img_x;
|
||||
clip_y: (root.get_y(idx)*256) - root.img_y;
|
||||
}
|
||||
|
||||
function get_x(idx: int) -> int {
|
||||
return mod(idx, 16);
|
||||
}
|
||||
|
||||
function get_y(idx: int) -> int {
|
||||
return floor(idx/16);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user