17 hours ago · Tech · 0 comments

I think I’ll try making the Button show up and down states. Sounds easy enough to spike something. I’ll check the API. There’s an add texture, I think, and some way to switch by index. OK, there is append_texture, and cur_texture_index, and set_texture. I think the first and last are what we want. My first question is whether instead of providing the texture on creation we can append even the first one. I’d bet the answer is yes. To find out, change this: class ContentView: error_texture = ':resources:images/items/star.png' def __init__(self, content_item, resource, scale=0.5): self.item = content_item try: texture = arcade.load_texture(resource) except (FileNotFoundError, AttributeError): texture = arcade.load_texture(self.error_texture) self.sprite = Sprite(texture) self.sprite.scale = scale_texture(self.sprite.texture, scale) To this: class ContentView: error_texture = ':resources:images/items/star.png' def __init__(self, content_item, resource, scale=0.5): self.item = content_item…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.