There are two issues that may be causing the gap. One is that your code:
self.pos_hint = {'x':0.7, 'y':0.1}
is setting a gap of one tenth of the container height.
The second issue is that Image
, by default, will not stretch the underlying image, and will not distort the image (stretching more in one direction than the other). So, you can get what you want by modifying your Building
class like this:
class Building(Image):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.source = 'Building.png'
self.size_hint = 0.4,1
self.pos_hint = {'right':1.0, 'y':0} # position image at right, bottom
self.allow_stretch = True # allow image to be stretched
self.keep_ratio = False # allow distortion
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…