How to code?
Hello, Im completely lost with my coding assignment. Here are the instuctions:
Summary
Kidder Garden Pete Burnham of the Kidder Garden website wants you to develop an application for drawing images or "stamps". As a proof of concept, he wants you to create a webpage in which users can choose stamps of a specified size and shade (opacity) and then place those stamp images on a canvas using the mouse.
The user can then modify the size, position, rotation, or shading (opacity) by clicking tools from a toolbar and applying that tool to a stamp image. Pete has already designed the webpage. He needs you to write the code to create the stamp objects and place them as images on the page's canvas. Figure 14-50 shows a preview of a completed page with stamp images created and modified by the user.
Pete has also supplied you with the following object methods that will be useful to you:
- The elementX() method for the Event object prototype that returns the x-coordinate of a mouse click event occurring within an element.
- The elementY() method for the Event object prototype that returns the y-coordinate of a mouse click event occurring within an element.
- The removeChildren() method that removes all child nodes from an element.
The final form of the code is up to you and may include enhancements that you think will add to the value of the final application, but it must include the following:
- An interface that shows the currently selected shape, size, and shading (opacity) controls and the currently selected tool from the toolbar.
- A custom stamp object that stores the shape, size, and shade (opacity) of a stamp.
- A custom game object that stores the current control and tool option selected by the user and includes an array named stamps that stores all stamp objects created by the user.
- A custom method named addToGame defined as a prototype for the class of stamp objects to add the stamp to the stamps array within the game object.
- A custom method named removeStamps defined as a prototype for the class of game objects to empty out the game object's stamps array.
- Functions to place stamp images on the page canvas at the location of the user's mouse click and add the stamp object to the game object's stamps array.
- Functions to modify the stamp image's size, position, rotation, and shading when the image is clicked by the user. Another function to remove the stamp image when clicked by the user and to remove the stamp object from the game object's stamps array.
- A function that removes all stamp images from the canvas and all stamp objects from the game object's stamps array, when the user clicks the garbage can icon.
Open the kg_stamps.js file in your editor.
Write code that will satisfy the conditions that Pete has given you for the final application (review the Introduction step).
Comment your work throughout, documenting all objects, properties, and methods you created for this project.
These are my tasks:
Create custom stamp object
The 'Shades' option allows changing the opacity of the next stamp to be placed
Button with id enlargeStamp allows increasing the width and/or height styles of a stamp
Button with id moveRight allows moving a stamp right on the canvas
Button with id lighten allows decreasing the value of the opacity style for a stamp
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps
- Which statements can you place in your JavaScript file to create a Google map for your web page? Assume that you have saved the geographic coordinates of the desired center of your map as an object literal called funPark and that you wish to display the map in the element whose reference you have assigned to the variable mapBox. let funParkMap = new google.maps.Map (mapBox, { zoom: 18, center: funPark } ); let funParkMap = new google.maps.Map{ location: mapBox, zoom: 18, center: funPark } ; let funParkMap = new google.maps.Map (mapBox, { center: funPark } ) ; let funParkMap = new google.maps.Map (mapBox, funPark) ;arrow_forwardIn Visual Studio Code, I need to be able to enter data into the fields. But if the user hits the submit values button and a field is empty, they get an error message (As in the provided images). The code goes something like this. <html> <head> <title>Week2 GP1 - Michael Porter</title> </head> <body> <form method='POST'> <h3>Enter your name: <input type="text" name="name"></h3> <h3>Enter your date of birth: <input type="text" name="birth"></h3> <h3>Enter your favorite color: <input type="text" name="color"></h3> <h3>Enter your favorite place to visit: <input type="text" name="fav_place"></h3> <h3>Enter your Nickname: <input type="text" name="nickname"></h3> <input type="submit" value="Submit Values"> </form> <?php $name = ''; $birth = ''; $color = '';…arrow_forward* IN VISUAL BASICSarrow_forward
- Suppose there is a text box on your browser window called FirstName. When you scroll up or down, the text box does not move at all while other elements on the page do move. What value for the position property would FirstName have? A) absolute B) relative C) fixed D) staticarrow_forwardInstructions Blood pressure monitor: Over the following three chapters, we will create an app that monitors blood pressure. You can model the app based on the Thyroid app. In this chapter, we will create the skeleton of the app, similar to the Thyroid app. Now, just create the pages and the links to navigate between them; you will implement the functionality of the pages in later chapters. The app will have A password-based entry page. A page to get basic information about the person such as name, date of birth, and health insurance card number, along with an ability to change the password. A menu page with four choices An option and corresponding page to allow you to change the basic information about the person. An option and corresponding page to enter data—blood pressure. An option and corresponding page to graph the data. An option and corresponding page to make recommendations based on the values of blood pressure. Note: post solution not steps. I need the code.arrow_forwardusing java create a login page using j frame included username and password as well as a login button. (Refer to image 1) Create a game menu with a image and below the image we have two clickable buttons (play game and instructions) when play game is clicked it proceeds to my trivia game And embeds them I the codes above into my trivia java game Here is part of my java code for the trivia game (If you are looking for the full go on YouTube and search bro code java quiz game the full code should be in the comments section import java.awt.event.*; import java.awt.*; import javax.swing.*; public class Quiz implements ActionListener { String[] questions = { "Factor the equation (X+3)(X+1)?", "Which company created Java?", }; String[][] options = { { "It cannot be factored", "X^2+4x+3", "2x^2+4x+3", " I don't know" }, { "Sun Microsystems", "Starbucks", "Microsoft", "Alphabet" }, char[] answers = { 'B',…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education