Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Sep 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    roulette javascript

    Hello! this is my first post.

    I am working on a website where I need a roulette. I chose this one.

    http://www.switchonthecode.com/tutor...#comment-11861

    My problem is that I can not get the text to become a link. (clickable)(a href)

    I am new to JavaScript and HTML 5 <canvas>

    But I can not get it to work :/

    Some good suggestions? I would Greatly appreciate.

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,613
    Thanks
    80
    Thanked 4,634 Times in 4,596 Posts
    What test? And where is your code? We can't see what you did wrong if you don't show us your code.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #3
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,308
    Thanks
    203
    Thanked 2,563 Times in 2,541 Posts
    Quote Originally Posted by Old Pedant View Post
    What test? And where is your code? We can't see what you did wrong if you don't show us your code.
    Text, not test. The code is presumably that given in the link.

    var restaraunts = ["Wendy's", "McDonalds", "Chick-fil-a", "Five Guys",
    "Gold Star", "La Mexicana", "Chipotle", "Tazza Mia",
    "Panera", "Just Crepes", "Arby's", "Indian"];

    He wants to make each restaurant a clickable link.
    Last edited by Philip M; 09-23-2012 at 10:54 AM.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #4
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    3,020
    Thanks
    56
    Thanked 566 Times in 563 Posts
    the problem is that text on a canvas is not text but rather a drawn shape, and therefore it's not as simple as turning "normal" html text into a link.

    what you basically have to do is save the locations of your text on the canvas and then turn them into clickable regions.

    you can google the subject - there are plenty of tutorials out there, but I would say that if you have only a basic understanding of html and js, this is a very ambitious undertaking at this point.

  • #5
    New to the CF scene
    Join Date
    Sep 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up

    ok thx!!


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •