Question

I am new to game development and I am making a simple game using construct 2.

The problem is that construct 2 provides basic html buttons, but I want to put background-image in button. So for that I want to add a custom css in my construct 2 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 doesnt work.. Any help regarding to this will be appreciated..

Was it helpful?

Solution

Finally I found the answer.. here is a plugin for construct 2 by using which we can import css to our construct 2 project..

https://www.scirra.com/forum/viewtopic.php?t=78007&start=0

I am sharing my answer so that it can help another users who are having same problem as me..

OTHER TIPS

Not sure about 'construct 2' generate a <button> tag or generate something else. but if its generate button tag.

you can try this css to apply a background image on <button> tag.

--Button CSS--

button{background-image:url(http://lorempixel.com/100/100);}

---HTML Button Code--

<button type="button">Click Me!</button> 

Working Demo http://jsbin.com/qupaxufo/1/edit

Actually you CAN add CSS in Construct 2 itself:

  1. For example, create event, select object that you want to style (but be certain that css is applicable on that object, your target is most probably some kind of input element).

  2. Then, select set CSS style, enter property and enter its value (ofc, you can't use pseudo-classes and some more advanced stuff, but there are workarounds even for that).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top