We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › SVG and mousover
Page Index Toggle Pages: 1
SVG and mousover (Read 762 times)
SVG and mousover
Apr 8th, 2009, 10:13am
 
Hey all,

I am working with a SVG map in a sketch, and I wanted to be able to have some things happen if users either mouseover or clicked on different parts of the map.  But the PShape library doesn't seem to have any methods for accessing the x and y locations of the elements, so I might be out of luck on this.  With the map that I have, each element is labeled and each country is it's own element, so in theory I could have something unique happen, but I can't find a way to access where that element is in the sketch, outside of the draw area, which is the same for all of the elements.

Any ideas?  Thanks!
Re: SVG and mousover
Reply #1 - Apr 9th, 2009, 1:47am
 
I use the geomerative library to do this (be aware that it's not  up-to-date with the latest Processing, and not even the examples provided are up-to-date with the library Wink - so you'll have to tweak some of the provided example/tutorial sketches to make them execute without errors).

http://www.ricardmarxer.com/processing/geomerative/documentation/

look at the 'tutorial_23_contains' sketch.
Re: SVG and mousover
Reply #2 - Apr 10th, 2009, 10:46am
 
Thank you!! That was exactly what I needed!  Also, I found an updated library here http://www.ricardmarxer.com/geomerative/
Re: SVG and mousover
Reply #3 - Apr 17th, 2009, 12:59am
 
Hi,

i am actually doing quite the same : using a svg map under processing.

I first gave a try to native SVG support and have some problems with size and positionning of my SVG map (see : processing.org/discourse/yabb2/num_1239903063_posted_yesterday__.html
Did you experience such problems

I will give a try to geomerative (Already used it to vector text animation).

Paul
Page Index Toggle Pages: 1