Jump to content
MakeWebGames

SLANTED ENERGY BARS !! Need Advise,.. !


jedigunz

Recommended Posts

So,. i saw the new COD ghosts,. and noticed the slanted bars and had the idea to implement the slanted bar idea into my game,.. now im having a few problems,.

I've found a way to SKEW an IMAGE using CSS,. But I'm experiencing problems,. wondered if anyone could help ???

Style:

 

.skew {
 -webkit-backface-visibility: hidden;
 -webkit-transform: skew(35deg, 0);
 overflow:hidden;

}

.skew img {
 -webkit-transform: skew(-35deg, 0);
}

 

Script:

 

<b>Energy:</b> {$enperc}%
<div class=skew><img src=baryellow.jpg width=$enperc height=7></div>
<div class=skew><img src=bargray.jpg width=$enopp height=7></div><br />

 

which resulted in this happening:

[ATTACH=CONFIG]1126[/ATTACH]

Ive tried this with 1 div covering the whole thing,. 1 div just the images,. seperate divs,. the image wont slant

any ideas that could help ??

slantedbars.jpg.257c4ae20c66fa519ebd5430765760b3.jpg

Edited by jedigunz
Link to comment
Share on other sites

what browser are you in chrome or safari? Because what you are using only works with those 2 browsers. I got a real crappy version to work just by copy and pasting it in the try it now of that method in w3schools.

[css]

.skew {

backface-visibility:hidden;

-webkit-backface-visibility:hidden; /* Chrome and Safari */

-moz-backface-visibility:hidden; /* Firefox */

-ms-backface-visibility:hidden; /* Internet Explorer */

transform: skew(35deg,0);

-ms-transform: skew(35,0); /* IE 9 */

-webkit-transform: skew(35deg,0); /* Safari and Chrome */

overflow: hidden;

}

.skew .img {

transform: skew(-35deg,0);

-ms-transform: skew(-35deg,0); /* IE 9 */

-webkit-transform: skew(-35deg,0); /* Safari and Chrome */

}

[/css]

The back trace doesn't work for opera FYI so no need to limit users browsers unless there is nothing you can do about it

**EDIT**

Try This

Edited by KyleMassacre
Link to comment
Share on other sites

im using chrome and it works pretty much perfect,. thanks Kyle ,.

only thing is the text wont stay next to the text,. can that be solved to,. without the text being Skewed as well ??

[ATTACH=CONFIG]1127[/ATTACH]

Script relating to image::

 

<b>Energy:</b> {$enperc}%<div class=skew><img src=baryellow.jpg width=$enperc height=7><img src=bargray.jpg width=$enopp height=7></div>
<div class=skew><b>Will:</b> {$wiperc}%<img src=baryellow.jpg width=$wiperc height=7><img src=bargray.jpg width=$wiopp height=7></div>

slantedbars2.jpg.dc950caf47e6ac8493615f2b88729c9a.jpg

Link to comment
Share on other sites

okay well ive gone with this

 

<table width=100%>
<tr>
<td><b>Energy:</b> {$enperc}%</td>
<td><div class=skew><img src=baryellow.jpg width=$enperc height=7><img src=bargray.jpg width=$enopp height=7></div></td>
</tr><tr>
<td><b>Will:</b> {$wiperc}%</td>
<td><div class=skew><img src=baryellow.jpg width=$wiperc height=7><img src=bargray.jpg width=$wiopp height=7></div></td>
</tr><tr>
<td><b>Brave:</b> {$ir['brave']}/{$ir['maxbrave']}</td>
<td><div class=skew><img src=baryellow.jpg width=$brperc height=7><img src=bargray.jpg width=$bropp height=7></div></td>
</tr><tr>
<td><b>EXP:</b> {$experc}%</td>
<td><div class=skew><img src=baryellow.jpg width=$experc height=7><img src=bargray.jpg width=$exopp height=7></div></td>
</tr><tr>
<td><b>Health:</b> {$hpperc}%</td>
<td><div class=skew><img src=baryellow.jpg width=$hpperc height=7><img src=bargray.jpg width=$hpopp height=7></div></td>
</tr>
</table>

 

which resulted in this,.. perfect :)

[ATTACH=CONFIG]1128[/ATTACH]

thanks for the help

slantedbars3.jpg.cb30f457a8d899cb052a8d062afa7e4f.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...