Sha256: 8f45927d869ab74f2ee48ba638a1be9a78ab7da5b23dfb99e6eb63a2716bc2e6
Contents?: true
Size: 496 Bytes
Versions: 10
Compression:
Stored size: 496 Bytes
Contents
# Move the pointer left and right across the image to change # its position. This program overlays one image over another # by modifying the alpha value of the image with the tint() function. def setup size 200, 200 @a = load_image "construct.jpg" @b = load_image "wash.jpg" @offset = 0.0 end def draw image @a, 0, 0 offset_target = map(mouse_x, 0, width, -@b.width/2 - width/2, 0) @offset += (offset_target - @offset) * 0.05 tint 255, 153 image @b, @offset, 20 end
Version data entries
10 entries across 10 versions & 1 rubygems