Adding custom CSS to construct 2
-
21-12-2019 - |
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..
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..
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:
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).
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).