CSS Button Styling

0 favourites
  • 2 posts
From the Asset Store
9 orchestral + 9 alternate chiptune-style arrangements of dynamic, RPG-style music for your media project.
  • I'm evaluating Construct 3 for my game project and am hoping somebody can instruct me on the proper way to style buttons in C3.

    Part 1

    I've been trying to use the "Set CSS style" action to set a button's font to a loaded web font (but am looking to change any font property at this point). I have this action triggered at by a System > On start of layout event. So far I'm not able to change any CSS font property of a button (size, font, etc) -- the button's font appearance remains unchanged. Background color works. I've tried both enabling/disabling Auto font size. What am I missing?

    Part 2

    Eventually I'm looking to change the font applied to a set of buttons, numbering anywhere from 20 to 60. To do this via Startup events seems inefficient. I've read online about the CS2 examples using an imported CSS file (style.css) with an id reference, but have been unable to make this work either. What's the proper C3 way to change the "font-family" property of entire sets of buttons in one go? Do I need to set the CSS of a layer (am guessing maybe this is a DIV in the actual layout)?

    FYI, I prefer to use buttons + custom fonts rather than sprites because I'm using icon fonts that contain all the symbols I need.

    Am very new to Construct -- thanks in advance for responses/suggestions.

    • Scott
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • OK, regarding Part 1 of my question, maybe I found a bug?

    If a font property (ie font-family) is applied by itself, C3 doesn't appear to apply any CSS.

    If a non font-related property is applied, then CSS is rendered.

    Is this intended behavior?

    Regardless, I could still use suggestions regarding Part 2 of my original question.

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