def __init__(self, **kw): super(RootWidget, self).__init__(**kw) texture = Image('img/wood.png').texture texture.wrap = 'repeat' texture.uvsize = (8, 8) with self.canvas: Rectangle(size=(2048, 2048), texture=texture)
def __init__(self, *args, **kw): super(RootWidget, self).__init__(*args, **kw) texture = Image('wood.png').texture texture.wrap = 'repeat' texture.uvsize = (8, 8) with self.canvas: Rectangle(size=(2048, 2048), texture=texture)
def getTexture(self, name, size): filename = join('art', name + '.png') texture = Image(filename).texture texture.wrap = 'repeat' texture.uvsize = size self.logger.info(filename) return texture
def getTexture(self,name, size): filename = join('art', name+'.png') texture = Image(filename).texture texture.wrap = 'repeat' texture.uvsize = size self.logger.info(filename) return texture
def __init__(self, *args, **kwargs) : super(ScreenNexus, self).__init__(*args, **kwargs) texture = Image(os.path.join("res", "tile.png")).texture # Create background texture texture.wrap = "repeat" texture.uvsize = (12, 24) with self.canvas.before : # Draw background Color(1, 1, 1) Rectangle(texture = texture, size = (Window.width, Window.height), pos = self.pos)
def grass_background(widget): bg_texture = Image('resources/grass/grass-texture.png', nocache=True).texture # get POT texture #bg_texture = bg_texture.get_region(0, 0, 64, 64) #bg_texture.uvpos = (0, 0) bg_texture.uvsize = (35, 35) bg_texture.wrap = 'repeat' # fill all the background with widget.canvas.before: Rectangle(pos=(0, 0), size=(2560, 2560), texture=bg_texture)
def getTexture(name, size=(CELL_SIZE, CELL_SIZE)): filename = spritePath.format(name) texture = Image(filename).texture texture.wrap = 'repeat' texture.uvsize = size return texture
def set_background(self): texture = Image('resources/interface/modal-background.png').texture texture.wrap = 'repeat' texture.uvsize = (2, 1) with self.canvas.before: Rectangle(texture=texture, size=self.size, pos=self.pos)
def getTexture(name, size): filename = join('art', name+'.png') texture = Image(filename).texture texture.wrap = 'repeat' texture.uvsize = size return texture
def getTexture(name, size=(CELL_SIZE, CELL_SIZE)): filename = spritePath.format(name) texture = Image(filename).texture texture.wrap = 'repeat' texture.uvsize = size return texture
def set_background(self): texture = Image('resources/interface/modal-background.png').texture texture.wrap = 'repeat' texture.uvsize = (2, 1) with self.canvas.before: Rectangle(texture=texture, size=self.size, pos=self.pos)