4
\$\begingroup\$

I am making a simple game using Construct2. My problem is that Construct2 provides basic HTML buttons, but I want to put a background-image on my buttons.

To do that, I want to add custom CSS to my project. But I am not finding any option to add CSS to my project. I have added the CSS in my files directory, but it doesn't automatically work so there must be something else I need to do?

\$\endgroup\$
2
\$\begingroup\$

I don't believe there is a Construct2-specific way to do this; you just add and refer to the relevant CSS as you would any other HTML project. That is:

  • Find the <head> element of the HTML page that you'd like to leverage your custom CSS in.
  • Add <link href="PATH-TO-STYLESHEET.css" rel="stylesheet" type="text/css" />, changing PATH-TO-STYLESHEET to refer to the CSS file you want to use (relative to the location of the containing HTML file).

You can find a more in-depth discussion, specific to Construct2, here], though it essentially just repeats the above advice.

(There are of course other ways, such as leveraging inline CSS within style attributes of individual HTML elements, but the above is the more common technique and allows you to avoid a lot of repetition.)

\$\endgroup\$
  • 2
    \$\begingroup\$ thanks for your answer.. But Finally I found the answer.. here is a plugin for construct 2 by using which we can import css to our construct 2 project.. scirra.com/forum/viewtopic.php?t=78007&start=0 \$\endgroup\$ – Nishant Solanki Feb 25 '14 at 17:58
  • \$\begingroup\$ That seems like it will work, but it likely just does a bunch of stuff for you automatically that you could do manually (see the guide I linked, from the same site). \$\endgroup\$ – Josh Feb 25 '14 at 17:59
  • \$\begingroup\$ yeah.. already tested it.. its working good... and yes.. looking to your link.. thanks \$\endgroup\$ – Nishant Solanki Feb 25 '14 at 18:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.