This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Svelte and Sapper in Action and have Mark Volkmann on-line!
See this thread for details.
Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

rectangle size, brown color

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Got two questions!
g.fillRect(140,100,20,70);
140 is the starting point in x
70 is the y point
modifying 20 I can make it wider
100 moves it up
How can I reduce the height???
How can I get brown color??? I can not find it.
Thanks in advance for your time
Nancy B
 
author and iconoclast
Posts: 24203
43
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The arguments to fillRect are the x and y coordinates of the top left corner, and the width and height of the rectangle, in that order. Note that as in most computer graphics APIs, Y=0 is in the upper left corner of the screen and increases as you move downwards.
"new Color(156, 93, 82)" is a nice JavaRanchy brown color, the color of Bruce the Moose's antlers.
 
Nancy Bradley
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you
Nancy
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic