2

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..

Nishant Solanki
  • 2,119
  • 3
  • 19
  • 32

3 Answers3

4

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..

Nishant Solanki
  • 2,119
  • 3
  • 19
  • 32
0

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

Kheema Pandey
  • 9,977
  • 4
  • 25
  • 26
  • Brother I am an 2 year experienced web designer and web developer, If this would be too easy as that than I already have done it before... @Kheema – Nishant Solanki Feb 25 '14 at 05:26
  • We are here to help the people. if you want really a working answer then you have to explained further.. like what HTML render code appear? – Kheema Pandey Feb 25 '14 at 05:29
  • `construct 2` is a `codeless` environment. We dont have to code in that .. Just `drag and drop` environment is there.. No any code is visible... If any code is visible there than I must have done something.. – Nishant Solanki Feb 25 '14 at 05:35
  • Great! then using Firefox Extension called `Firebug` can you pelase tell what code generated? – Kheema Pandey Feb 25 '14 at 05:42
  • Already Done it... :( , `firebug` and `developer tools` as well..`external css` are getting generated.. but dont know how and from where... – Nishant Solanki Feb 25 '14 at 05:47
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/48331/discussion-between-kheema-pandey-and-nishant-solanki) – Kheema Pandey Feb 25 '14 at 05:52
  • can you chat: so we can find a solution. – Kheema Pandey Feb 25 '14 at 05:57
0

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).

Drops
  • 2,680
  • 18
  • 16