It looks like you're new here. If you want to get involved, click one of these buttons!
self.current_background_id = self.current_background_id + 1 local texture_current_bg = Texture.new("gfx_tiled/bg"..self.current_background_id..".png", true, {wrap = Texture.REPEAT}) local texture_width = texture_current_bg:getWidth() local minimum_width = application:getLogicalWidth()*2 local minimum_repeats = math.toint((minimum_width/texture_width)+3) local w = texture_width*minimum_repeats local h = texture_current_bg:getHeight() local shape_bg = Shape.new() shape_bg:setFillStyle(Shape.TEXTURE, texture_current_bg) shape_bg:beginPath() shape_bg:moveTo(0,0) shape_bg:lineTo(w, 0) shape_bg:lineTo(w, -h) shape_bg:lineTo(0, -h) shape_bg:lineTo(0, 0) shape_bg:endPath() |
Comments