How do I add CSS styling to an image?

0 favourites
  • 6 posts
From the Asset Store
Kids Game
$49 USD
New Sounds Added Update: 115 new sound effects added for no additional cost!
  • There is an action to set a CSS style on a text input control. I want to set a CSS style to my image which is currently a sprite. Can a text input control be set to an image?

    Tagged:

  • i don't think that is possible, since the sprites are rendered by the canvas element, which makes them not be a html5 object.

    here is a similar topic about sprites and css styles topic sprite css

    about text input control, if you mean if you can control a sprite by using a text input, is possible, but what are you trying to make, so we can better respond?

  • Thanks for replying. You asked what I am trying to achieve. I just wanted to make my images round using border-radius property of CSS. Like shown here w3schools.com/css/css3_images.asp

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • In construct we use frames for that, so you have to draw the frame in that shape, or use a effect that does that. im not sure now which effect would do the border part in Construct, but im pretty sure there is one... by this time for sure somebody did it, if not is a official one.

    You can also use blending modes and have 2 sprites overlapping each other one being round one being squared the one on top is the round one and then u do blendmode source-a-top i think. and should cut the excess of the bellow sprite.

  • Ok thanks GeorgeZaharia

  • no problem.

    About the image with css border, i think you could use javascript to create a object similar to html5 using the browser object and executejs command, or you could use a button object remove the text object from it, then use css and customize it and for the image you can load the image as a background image inside the button. not sure if it will work, but you could give it a try :D

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