Sign in to follow this  

Image, Button or Sprite?

Recommended Posts


I would like to understand which option should I choose for a clickable image: My assumptions are: if I want my "button" to participate in physics, I should go with a Sprite. If my "button" does not involve physics, I can choose either Button or Image. Button from images differs that they have functionality to show different image frames for different states of a button (out, over, up). If I do not want my button to have different states, i should go with Image.

Are my assumptions correct? Can you provide more real life scenarios when you have chosen one type of clickable image or the other and reasons behind that decision.

For example, currently I would like to implement inventory item which is a rectangle shaped image. When user clicks it, button should show that the inventory item is selected by showing a dashed red rectangle with rounded corners around the item. As I understand, I should go with Image because I need "selected" state, which Button does not currently have and I have to implement it myself anyway. I do not know whats the best way to implement that dashed rectangle around the inventory item though - I would like to have it reused since all inventory items presumably have the same dimensions.


Share this post

Link to post
Share on other sites

Hey! That sounds about right to me. Or, at least, that's what I've been doing in my games and it's worked so far. ( =

As far as button not having a selected state: it *does* have enough signals (onInputDown, onInputUp) that you could set the selected state yourself. Ignore the constructor and GameObjectFactory parameters and set it manually, maybe in a derived class yourself. Does that make sense?

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.