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

  • Home
  • SEARCH
  • 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 8420475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:53:36+00:00 2026-06-10T02:53:36+00:00

I have an interactive application mockup made with PaperJS but it still lacks a

  • 0

I have an interactive application mockup made with PaperJS but it still lacks a small feature. I need to draw a 2D grid (you know… that uniform mesh of lines that repeat endlessly over a surface), it will be used as guides for user interactions when dragging things over the screen (but the grid itself can be completely static).

I just don’t know how to implement it in PaperJS. It can’t be just a background image since it will be presented in different scales, also I wanted it to be rendered very fast since it will always be visible.

The type of grid I would like to draw is a 2D mesh centered grid, like in the example (a) of this picture:

2D basic grid types

Any enlightenment is welcome.

  • 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-10T02:53:37+00:00Added an answer on June 10, 2026 at 2:53 am

    If all you want is lines:

    var drawGridLines = function(num_rectangles_wide, num_rectangles_tall, boundingRect) {
        var width_per_rectangle = boundingRect.width / num_rectangles_wide;
        var height_per_rectangle = boundingRect.height / num_rectangles_tall;
        for (var i = 0; i <= num_rectangles_wide; i++) {
            var xPos = boundingRect.left + i * width_per_rectangle;
            var topPoint = new paper.Point(xPos, boundingRect.top);
            var bottomPoint = new paper.Point(xPos, boundingRect.bottom);
            var aLine = new paper.Path.Line(topPoint, bottomPoint);
            aLine.strokeColor = 'black';
        }
        for (var i = 0; i <= num_rectangles_tall; i++) {
            var yPos = boundingRect.top + i * height_per_rectangle;
            var leftPoint = new paper.Point(boundingRect.left, yPos);
            var rightPoint = new paper.Point(boundingRect.right, yPos);
            var aLine = new paper.Path.Line(leftPoint, rightPoint);
            aLine.strokeColor = 'black';
        }
    }
    
    drawGridLines(4, 4, paper.view.bounds);
    

    If you want each rectangle to be a separate Path to hitTest for the individual rectangles:

    var drawGridRects = function(num_rectangles_wide, num_rectangles_tall, boundingRect) {
        var width_per_rectangle = boundingRect.width / num_rectangles_wide;
        var height_per_rectangle = boundingRect.height / num_rectangles_tall;
        for (var i = 0; i < num_rectangles_wide; i++) {
            for (var j = 0; j < num_rectangles_tall; j++) {
                var aRect = new paper.Path.Rectangle(boundingRect.left + i * width_per_rectangle, boundingRect.top + j * height_per_rectangle, width_per_rectangle, height_per_rectangle);
                aRect.strokeColor = 'white';
                aRect.fillColor = 'black';
            }
        }
    }
    
    drawGridRects(4, 4, paper.view.bounds);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an projector file/Flash application that I need to turn into an interactive
I need a section of my application to have an interactive map of a
I am trying to write a small interactive game-like application, where I need to
I have an interactive web application powered by jQuery where users can manipulate visual
I have a UILabel in an interactive calculator application that is continually being refreshed
I have inherited a 20-year-old interactive command-line unix application that is no longer supported
I am developing interactive chart library...and application, which use it. In application, I have
I have started to develop E-Learning application and want to know Are There any
Our team wants to create a secure interactive application in silverlight. But as I
I am developing an ASP.NET intranet application that needs to have an interactive map

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.