Character that wanders above a certian point
3 posters
Page 1 of 1
Character that wanders above a certian point
Okay so this one is just to make the forum im administrating look cool, I want there to be a little pixelated character that wanders around (He cant wander off the edges of a certian point) and uses seperate Images for each animation (GIF file should allow me to animate it)
I am using Phbb2
Here is the website: http://cavestoryroleplay.forumotion.com/
So yeah, I think it would be possible using 4 different images. Two for standing still (Facing left and right) And Two for walking (Facing left and right)
I am using Phbb2
Here is the website: http://cavestoryroleplay.forumotion.com/
So yeah, I think it would be possible using 4 different images. Two for standing still (Facing left and right) And Two for walking (Facing left and right)
Last edited by Hax4Ever on January 10th 2015, 5:55 pm; edited 1 time in total (Reason for editing : Forgot to put it solved a long time ago :P)
Re: Character that wanders above a certian point
Hello @Hax4Ever,
That's possible. When I'm bored I sometimes end up writing some silly things. I dug this out of some old files..
Go to Administration Panel > Modules > JavaScript codes management > Create a new script
Title : Your choice
Placement : In all the pages ( if you want )
Plop this into the codebox :
You can change the following :
leftImage : The image displayed when the image is animated to the left
rightImage : The image displayed when the image is animated to the right
speed : How fast the image moves
That's possible. When I'm bored I sometimes end up writing some silly things. I dug this out of some old files..
Go to Administration Panel > Modules > JavaScript codes management > Create a new script
Title : Your choice
Placement : In all the pages ( if you want )
Plop this into the codebox :
- Code:
$(function() {
var leftImage = 'http://i59.servimg.com/u/f59/19/05/20/85/spin10.gif',
rightImage = 'http://i59.servimg.com/u/f59/19/05/20/85/spin10.gif',
speed = 40,
eliza = document.createElement('IMG'), pos = 'positive', node = document.getElementById('fa_ticker_container');
eliza.src=rightImage;
eliza.setAttribute('style','position:relative;left:0%;bottom:0;');
node.parentNode.insertBefore(eliza,node);
window.setInterval(function(){
if (pos === 'positive') {
eliza.style.left = getLeft() + 1 + '%';
if (getLeft() >= 97) pos = 'negative', eliza.src = leftImage;
} else if (pos === 'negative') {
eliza.style.left = getLeft() - 1 + '%';
if (getLeft() <= 0) pos = 'positive', eliza.src = rightImage;
}
},speed);
function getLeft() { return Number(eliza.style.left.replace(/%/,'')) }
});
You can change the following :
leftImage : The image displayed when the image is animated to the left
rightImage : The image displayed when the image is animated to the right
speed : How fast the image moves
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum