Mantra

by DivineTraveller
Create your own spells, and embark on a quest to save or destroy the lands!
ID:107671
 
Keywords: mantra, tooltip
I have simply a picture to present today:



Tooltips! They pop up wherever your mouse is, thanks to some clever javascript (I ended up pulling it out of Loduwijk's KeyState library, and tweaking it):
        update_mouse()
src << output({"
<html>
<head>
<script type="text/javascript">
function coordinate(event)
{
window.location="?action=mousecoord&x="+event.screenX+"&y="+event.screenY
}
</script>
</head>
<body onload="coordinate(event)">
</body>
</html>
"}
,"window1.browser1")


Much thanks to Koil for actually writing the tooltip part of the code and saving me soooooo much time.
Librarification!
I can't really, unless Koil says I can. The whole tooltip thing is his code.
Also, lol @ the filter for changing body onload to body disabledload. Didn't even catch that until now. :D
I think Hiro the Dragon King was working on some type of library that would use JavaScript to provide information to DM but I can never seem to find a link to anything about it. I know that he and I had talked about ways to get the position of the window using JavaScript. Maybe you could look into it and combine this to create a single, bigger "use JS to do neat things" type of library instead of having many individual libraries of that sort floating around.
Setting window.location in JavaScript seems to be the same as calling link("?topic").
I've been wondering if it'd be possible to make a BYOND game with mainly JavaScript(which is processed client-side and faster than DM), just by tossing certain parameters between them, essentially using BYOND only for the built-in networking.
HTML5's canvas would replace the map control, and you can make yourself a 3D BYOND game with raycasting or something.
i care so little what you do with that code that it's almost negative infinity
I actually am. I've been kind of distracted from it recently. The reason it's taking so long is because I've had to rewrite it a bunch of times upon new inspiration.

The newest and unfinished iteration can/will deliver accurate pixel-based coordinates of the mouse on the client's map and screen, and convert them into tile-based coordinates. It also allows you to drag objects either on the screen or map, and between map screens. And this is multiplayer ready as the server does none of the work.

There's a few more things, but I haven't worked out some of the kinks.
Nifty. =)
Forum_account wrote:
I think Hiro the Dragon King was working on some type of library that would use JavaScript to provide information to DM but I can never seem to find a link to anything about it. I know that he and I had talked about ways to get the position of the window using JavaScript. Maybe you could look into it and combine this to create a single, bigger "use JS to do neat things" type of library instead of having many individual libraries of that sort floating around.

Agreed. My Alphabetization library seems rather pointless to convey now compared to DT's method anyways. Might be taking that down soon.