Coder Social home page Coder Social logo

mikechambers / examplesbymesh Goto Github PK

View Code? Open in Web Editor NEW
408.0 408.0 185.0 2.48 MB

Various examples and code created and shared by Mike Chambers

Home Page: http://www.mikechambers.com

Processing 3.95% ActionScript 9.30% JavaScript 60.53% CSS 8.39% HTML 17.83%

examplesbymesh's People

Contributors

dclowd9901 avatar mikechambers avatar qqwy avatar statico avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

examplesbymesh's Issues

BoundNodes do not use width and height for retrieve() calls

I am trying to use this QuadTree implementation as a collision detection algorithm with lots of tiles.

however, it seems that there is no special _findIndex() method in the BoundNode class. This means that no matter the size of the colliding object, only the top left corner will be used to determine what objects to retrieve.

This is easily fixable by adding an extra check in the retrieve() function as well as an extra function that simply returns all the contents of a certain node. I'll upload my own fix shortly.

Mouse event stops working with image

Hi,
Hopefully a quick (but mysterious!) problem. The following very short page works perfectly until line55 is added ("button.addChild(img);"). I have no idea why.

I have already tried renaming the variables, and creating "button1" and "button2" objects (instead of reassigning "button").

Please help. Thank you, and much appreciated!

FYI If you cannot see the code below, the page can be found at: http://bit.ly/UDZVB7

<title>EaselJS button problem</title> <script src="http://code.createjs.com/easeljs-0.5.0.min.js"></script> <script> var stage, output;
    function init() {
        canvas = document.getElementById("tileCanvas");
        stage = new createjs.Stage(canvas);
        stage.mouseMoveOutside = true; 

        var rect, label, button;

        // Create first button
        button = new createjs.Container();
        button.name = "button_1";
        button.x = 50; button.y = 30;
        button.onClick = handleClick;

        rect = new createjs.Shape();
        rect.name = "rectangle_1";
        rect.graphics.beginFill("green").drawRoundRect(0, 0, 180, 50, 10);

        label = new createjs.Text("click me (1)", "bold 18px Arial", "#FFFFFF");
        label.textAlign = "center";
        label.textBaseline = "middle";
        label.x = 180/2; label.y = 50/2;

        button.addChild(rect, label);
        stage.addChild(button);

        // Create second button
        button = new createjs.Container();
        button.name = "button_2";
        button.x = 300; button.y = 30;
        button.onClick = handleClick;

        rect = new createjs.Shape();
        rect.name = "rectangle_2";
        rect.graphics.beginFill("green").drawRoundRect(0, 0, 180, 50, 10);

        label = new createjs.Text("click me (2)", "bold 18px Arial", "#FFFFFF");
        label.textAlign = "center";
        label.textBaseline = "middle";
        label.x = 180/2; label.y = 50/2;

        button.addChild(rect, label);

            // Add image
            var img = new createjs.Bitmap("http://cdn1.sbnation.com/community_logos/9156/gangreen-small.jpg");
            img.x = 5; img.y = 5;
            /* Add this line to recreate problem */
            // button.addChild(img);
            /*************************************/

        stage.addChild(button);


        createjs.Ticker.addListener(stage);
        stage.update();
    }

    function handleClick(evt) {
        alert("Clicked on: " + evt.target.name);
    }
</script>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.