Coder Social home page Coder Social logo

yosuke-furukawa / tmlib.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from phi-jp/tmlib.js

0.0 3.0 0.0 23.98 MB

JavaScript をより使いやすく, より便利に, そしてより豊かに.

Home Page: http://tmlife.net

JavaScript 99.98% Shell 0.02%

tmlib.js's Introduction

JavaScript をより使いやすく, より便利に, そしてより豊かに』を
コンセプトに制作した JavaScript ライブラリです.

やってることは

  • 生成時に new がいらない class 定義の仕組みを作ってみたり
  • jQuery ライクに DOM を扱えるようにしたり
  • ajax 機能をサポートしてみたり
  • HTML5 Canvas をラップして使いやすくしたり
  • アニメーションできるようにしてみたり
  • ベクトルや行列をサポートしてみたり
  • 音を鳴らせるようにしてみたり
  • 入力系をサポートしてみたり
  • 1つのコードで PC とスマホ同時対応できるようにしてみたり

と色々やってます.

Examples - Documentation - Download

Download

Documentation

ドキュメントはこちら

Usage

使い方

<script src="tmlib.js"></script>

読み込み後は下記のような形で使用します.

<!DOCTYPE html>

<html>
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, user-scalable=no" />
        <meta name="apple-mobile-web-app-capable" content="yes" />
        
        <title>Starter Pack | tmlib.js</title>
        <link rel="apple-touch-icon-precomposed" href="icon.png" />
        
        <script src="https://raw.github.com/phi1618/tmlib.js/0.1.3/build/tmlib.js"></script>
        <script>
            // メイン処理(ページ読み込み後に実行される)
            tm.main(function() {
                // アプリケーション作成
                var app = tm.app.CanvasApp("#world");
                app.resizeWindow(); // 画面サイズに合わせる
                app.fitWindow();    // リサイズ対応
                app.background = "rgba(0, 0, 0, 0.1)";  // 背景色をセット
                
                // 星スプライト
                var star = tm.app.Shape(64, 64);
                star.canvas.setColorStyle("white", "yellow").fillStar(32, 32, 32, 5);
                app.currentScene.addChild(star);    // シーンに追加
                
                // 更新
                app.currentScene.update = function(app) {
                    // マウス位置 or タッチ位置に移動
                    star.x = app.pointing.x;
                    star.y = app.pointing.y;
                    // クリック or タッチ中は回転させる
                    if (app.pointing.getPointing() == true) { star.rotation += 15; }
                };
                
                // 実行
                app.run();
            });
        </script>
    </head>
    <body>
        <canvas id="world"></canvas>
    </body>
</html>

Examples

使用例です. 随時追加していきます.
また, 「こんなん作ってみた」とかあれば教えて下さい.

screenshot screenshot screenshot screenshot screenshot screenshot screenshot screenshot screenshot screenshot screenshot screenshot screenshot screenshot

License

MIT License

Browser

対応ブラウザの一覧です.
IE なんて知りません.

Resource

当プロジェクトで使用させていただいている画像・音楽はこちらの皆様からお借りしております.

Music

Blog

tmlib.js に関する最新の情報やチュートリアルなどはこちらのブログで紹介していきます.

TM Life

tmlib.js's People

Contributors

phi-jp avatar daishihmr avatar minimo avatar

Watchers

Yosuke Furukawa avatar James Cloos avatar  avatar

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.