www.webdeveloper.com
Results 1 to 6 of 6

Thread: try this again... (newbie)

  1. #1
    Join Date
    Jan 2004
    Location
    Vance AFB
    Posts
    3

    try this again... (newbie)

    Ok I've searched a total of 5 hours now with no luck, so I'm resorting to here.

    I'm looking for a .js file that will run the drawArc method. I have a something.js that runs a lot of shapes, but NOT drawArc.

    I'm only 2 days into this, so I have no idea how the .js files work, or else I'd make my own.

    As of now, I'd like it to stay DHTML and work in .html files.

    Does anyone know where I can find what I'm looking for, or can you give me a quick 1,2,3 on how to custom create a .js file?

    thanks

  2. #2
    Join Date
    Jan 2004
    Posts
    10
    The quick 1,2,3,4 on creating a .js file is this:

    1) Open a text editor, create a new document, and save it as 'whatever'.js

    2) Put some javascript in it

    3) Import it into an HTML page like this: <script src="whatever.js"></script>

    4) Call the functions you created from your HTML

    Now, to the drawArc. I'm not really sure how this could be done. You cannot get a canvas to draw on in DHTML. I would be interested to know what other shapes you can draw. I can only think of how you could draw rectangles and squares.

    If you have some .js files that draw other shapes, feel free to send them to me in a private message and I will take a look at them. If I can figure out how they are drawing other shapes, I may be able to figure something out for an arc.

    Michael.

  3. #3
    Join Date
    Jan 2004
    Location
    Vance AFB
    Posts
    3
    Hello and thanks for the reply!

    I do have a .js file that seems to draw every other shape except for an Arc (and I'm calling it drawArc because there's drawLine, drawEllipse, ect). I just don't understand why arc would be left out, unless there's no possible way to create it. I searched high and low for a separate .js but never found anything.

    The file is called jsgraphics.js and you can see it and download it from the same page here:

    http://www.walterzorn.com/jsgraphics/jsgraphics_e.htm
    Last edited by Flight407; 01-28-2004 at 08:15 AM.

  4. #4
    Join Date
    Jun 2008
    Posts
    1

    Found solution

    I had the same problem (I am working with wood sheetmaterial and wanna show what kinda products we can deliver). I found the solution, try this:

    jg.fillArc(-50,-25,100,100,0.0,90.0);
    jg.setColor("#cccccc");
    jg.fillArc(-10,15,20,20,0.0,90.0);
    jg.paint();

    #cccccc is my background color
    hope this works for you too
    If you want it different just experiment with the values.

    EDIT: little outdated??

  5. #5
    Join Date
    Jan 2004
    Location
    Vance AFB
    Posts
    3
    haha! I just found my password to this site sitting in an e-mail that's 10 years old. I had not logged in since Jan, 2004. That means it's been 10+ years. Oh and guess what else...... I'm still fussing with .js files!! But I can write them now, thanks everyone!

  6. #6
    Join Date
    May 2006
    Location
    Somewhere behind your screen
    Posts
    1,656
    i think the site has not changed a lot since your last login 10 years ago

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles