Skip to content

Instantly share code, notes, and snippets.

@kadir014
Created February 5, 2020 15:41
Show Gist options
  • Save kadir014/b385ff2b52f1dfefa520afeaaf5fe749 to your computer and use it in GitHub Desktop.
Save kadir014/b385ff2b52f1dfefa520afeaaf5fe749 to your computer and use it in GitHub Desktop.
from heat2d import *
engine = Engine()
engine.window.title = "Heat2D UI Testing"
engine.window.clear_color = (255, 255, 255)
class Mario(GameObject):
def __init__(self):
super().__init__()
self.x, self.y = engine.window.center
self.sprite = Sprite("mario_sprite.png")
self.sprite.scale(12)
def update(self):
self.sprite.rotate_to(self.x, self.y, engine.mouse_x, engine.mouse_y)
class Main(Stage):
def __init__(self):
super().__init__()
self.add(Mario)
test = ui.UILayer((200, 200), (350, 90))
test.back_surface.fill((0, 0, 0, 128))
test.set_effect(postprocess.GaussianBlur(radius=3))
engine.add(Main, test)
engine.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment