Simple scale concept
This commit is contained in:
@@ -3,14 +3,17 @@ component VRAMSegment inherits Rectangle {
|
||||
in property <image> img;
|
||||
in property <int> clip_x;
|
||||
in property <int> clip_y;
|
||||
in property <int> scale: 1;
|
||||
|
||||
width: 64px;
|
||||
height: 256px;
|
||||
width: 64px*scale;
|
||||
height: 256px*scale;
|
||||
clip: true;
|
||||
Image {
|
||||
source: img;
|
||||
x: -root.clip_x*1px;
|
||||
y: -root.clip_y*1px;
|
||||
x: -root.clip_x*1px*scale;
|
||||
y: -root.clip_y*1px*scale;
|
||||
width: img.width*1px*scale;
|
||||
height: img.height*1px*scale;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,17 +21,19 @@ export component VRAMArea inherits Rectangle {
|
||||
in property <image> img;
|
||||
in property <int> img_x;
|
||||
in property <int> img_y;
|
||||
in property <int> scale: 1;
|
||||
|
||||
width: (64*16+15)*1px;
|
||||
height: (256*2+1)*1px;
|
||||
width: ((64*16+15)*1px)*scale;
|
||||
height: ((256*2+1)*1px)*scale;
|
||||
|
||||
for idx in 32 : VRAMSegment {
|
||||
x: root.get_x(idx)*(64px + 1px);
|
||||
y: root.get_y(idx)*(256px + 1px);
|
||||
x: (root.get_x(idx)*(64px + 1px))*scale;
|
||||
y: (root.get_y(idx)*(256px + 1px))*scale;
|
||||
|
||||
img: img;
|
||||
clip_x: (root.get_x(idx)*64) - root.img_x;
|
||||
clip_y: (root.get_y(idx)*256) - root.img_y;
|
||||
scale: root.scale;
|
||||
}
|
||||
|
||||
function get_x(idx: int) -> int {
|
||||
|
Reference in New Issue
Block a user