def test_draw(self): surface = gfx.Surface((10, 10 * 3)) sprite = gfx.SpriteFilm(surface) sprite.set_div(1, 3) assert sprite.width == 10 and sprite.height == 10 button = gui.ImageButton(sprite) background = gfx.Surface((100, 100)) button.draw(background, 0, 0)
def test_init(self): surface = gfx.Surface((10, 10 * 4)) sprite = gfx.SpriteFilm(surface) sprite.set_div(1, 4) assert sprite.width == 10 and sprite.height == 10 button = gui.ImageButton(sprite)
def draw(self, Model, ModelView): model = Model() model_view = ModelView(model) model.container = Container() surf = gfx.Surface((50, 50)) for i in range(0, 10): time_sec = i * 0.001 frame = m_frame.Frame(surf, time_sec, 0.0) model_view.draw(frame)
def test_get_pickup_pos(self): """Given a goldcar and view when goldcar pos is None then get_pickup_pos returns None""" # Given goldcar = m_player.GoldCar(None, 1) goldcarview = m_playerview.GoldCarView(goldcar) surface = gfx.Surface((20, 20)) frame = m_frame.Frame(surface, 0.0, 0.0) frame.interpol = 0.0 # Then goldcarview.get_pickup_pos(frame)