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 8341805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T05:35:39+00:00 2026-06-09T05:35:39+00:00

I am experimenting with HTML5 Canvases in an attempt to create some animation. My

  • 0

I am experimenting with HTML5 Canvases in an attempt to create some animation. My ultimate goal is to be able to animate a box to a particular location at whim, for now im just animating it across the screen. When I move it across the screen I geta black trail left behind, how do I clear this “dirty” section without removing the background grid?

A jsFiddle of the code is here

  • 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-09T05:35:41+00:00Added an answer on June 9, 2026 at 5:35 am

    Two solutions

    • Redraw the background on the top of animation before moving it to the new location. This so called dirty sprite technique – faster – more complex.

    • Redraw the whole canvas between frames

    If drawing the background is a complex operation just hold a prepared background buffered in another canvas for speed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm experimenting with HTML5's new canvas tag, in which I render and animate some
I'm experimenting with HTML5's Drag and Drop. I'm trying to drag an html button.
I'm experimenting with using html5 and css counters to number the figures in a
I'm experimenting playing video in a UIWebView. If I have some html like this:
While experimenting with pixel shaders in WPF I decided to draw some pixels onto
If I have a HTML element <header> and apply some margins to this HTML5
I am experimenting with embedding my pure offline mobile HTML5 ebook reader (http://www.hyper-books.com/) into
I've been doing some experimenting with php and html, and I'd like to know
I am planning on experimenting with realtime game development using html5 and node.js. I
I'm experimenting with HTML5 geolocation, and embedded a small test script into a page

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.