Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8587089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:28:53+00:00 2026-06-11T22:28:53+00:00

I am making a javascript game and I would like to be able to

  • 0

I am making a javascript game and I would like to be able to add a main menu but I don’t know exactley how. I am lookign up for a way to make filltext() clickable but to no avail. I have looked it up but have found no answer that suites my needs. The games protoype can be viewed here: sketchy.idreesinc.com . Does anyone know anyway to implement this? I am using javacript and HTML5’s canvas element but I would prefer javascript. Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T22:28:54+00:00Added an answer on June 11, 2026 at 10:28 pm

    Things to know about HTML and canvas first

    DOM

    HTML elements are part of the DOM (the Document Object Model) which is the data structure of a webpage. DOM elements can have trigger events (like click) and event listeners react to those events.

    browser

    Your web browser converts the DOM elements into pixels on your screen. It also handles input and figures out what element’s events to trigger if you click on the page.

    canvas

    The canvas element allows you to render bitmap images. You basically set the colors on a grid of pixels through some javascript calls to make pretty pictures.

    what that all means

    When you create a link element in HTML (the <a> tag) the browser renders the text and attaches a click listener to the element so the link actually works.

    When you use javascript to draw the pixels on the canvas the browser’s understanding of the DOM stops at the canvas. The browser knows about the DOM and the DOM knows about the canvas but it doesn’t keep track of the individual items drawn in the canvas.

    The answer

    You can’t actually attach an event to the text in the canvas but there are many ways to get the desired behavior of click the text, something happens.

    One way would be to attach a click event to the canvas but instead of a simple event listener that always runs this event listener would need to check to see if the click happened on the text or somewhere else on the canvas.

    Event listener functions get called with an Event argument which has information about the event.

    Things to google

    Some quick reading about these should get you started towards a working menu.

    • registering javascript event listeners
    • javascript event mouse coordinates
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on making a simple Javascript game and need to be able
I'm making a spot-the-difference game in HTML, CSS + Javascript, but one of the
I'm making a javascript game in which I want enemy ships to be able
I'm making a javascript game but (not browser-based) but the engine I'm using has
I'm making a html5 game and while I'd like to be able to publish
I am making a 2D game in javascript/ajax, that will be using data stored
I'm making a simple game in Javascript, in which when an object collides with
I'm making a javascript game and need to bind a lot of keys to
I'm making a game using canvas, and javascript. When the page is longer than
I am making a Javascript game with the canvas tag, and I am using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.