Buttons with Image

0 favourites
  • 9 posts
From the Asset Store
Elevate your games with our AI Chatbot Integration! Seamlessly connect your Construct 3 projects with GPT-4 for dynamic,
  • There is a way to put images in buttons?

    Or Spawning ISpriteInstances with images inside buttons?

  • I'm wondering the exact same thing.

    As far as I know it seems like you need a background tile on top of a button

  • Generally you want to avoid using any of the form-control objects as much as possible, in my opinion at least. There are cases where you have to use them and cases where they work very well actually, but overall they just create headaches, mostly because...

    Try using sprites/9patch + "mouse - on object clicked" instead for your button needs. If you absolutely have to use the form-controls, you can only style them with limited CSS, see construct.net/en/make-games/manuals/construct-3/plugin-reference/button

    A last ditch option is to place a sprite of how you want the button to look like behind the button object, and set the button object to be at 0.000001% opacity. (Just 0% will not work)

  • You can put images on buttons, with css, but they only work after export, and as said before, they float over canvas, you can z-order the form controls with css, but they will always be on top of sprite, etc

    A basic example, I used only buttons here, with z-order, but it's clunky, so I would not recommend.

    https://www.sizzle-games.com/cardflip/

  • If you only need an on click event for your Objects. I would use a normal sprite and add an event listener to it.

    Here you can find an example.

    Why would you use a button for that?

  • Why would you use a button for that?

    I'd say it's a bit of a trap for new users. You need a button and there is a dedicated button-object, seems like a reasonable idea to use it. Until you realize how restricted and terrible they are to use.

  • why not just use images(sprites) as buttons instead? (not the best "saving memory" way, but it works, and u have them inside ur project at all times.)

    if new C3 feature allows u to do normal CSS or js, you can pick a button by it's id or class and apply a background image with a "contain" background size or a background-size:contain or a background-size:100% 100%... and position center. make sure ur image and button are the same size... or there will be "visual chops"

  • GeorgeZaharia Can you give us an example?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • GeorgeZaharia Can you give us an example?

    i can't in C3 but with C2 just create a sprite object add ur image there.... then with browser and touch plugin u say something like this

    On touched "sprite" }action } browser.openInNew... (your url). with C3 similary should work also.

    the coding way i cant use the C3 advanced features... my premium license expired... but if you know javascript a bit or regular HTML + CSS should work, the same

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)