Giter Site home page Giter Site logo

neon-1's Introduction

neon

一. 简介

lua 类mvc framework,支持 cocos2dx-3.4

基本模块包括: Neon, View, Events, Logger

分别功能如下:

  • Neon

    代码使用 app - 多views 的方式

    每个app绑定一个scene,即生命周期与scene一致

    每个view相当于一个layer,上面可以进行任意的展示.

    一般小游戏,单个app就足够了,不同页面使用view来实现即可。如果涉及大型游戏,需要多个app也是可以的.

  • View

    上文提到的View

  • Events

    事件通知 默认的 neon.events 是跨app的

  • Logger

    日志。默认有 neon.logger

二. 使用说明

  • 继承Neon后最主要的函数是 onRun(params)
  • 继承View后,最主要的函数是 onRender(params)

view 区分 onCreate 和 onRender(params) 的好处在于,onCreate可以处理那些与传入数据没关系的,而onRender则是与数据有关,比如flask的render_template。

另一方面,把所有展示逻辑都放在onCreate里面也不太好,毕竟createView调用了onCreate时,还没有将生成的view放到app.views里面。而用onRender可以弥补这个不足。

neon-1's People

Contributors

dantezhu avatar

Watchers

 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.