Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Jan 9, 2018
1 parent a4e9ae3 commit adde812
Show file tree
Hide file tree
Showing 48 changed files with 2,311 additions and 2 deletions.
66 changes: 64 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,64 @@
# FairyGUI-vision
A flexible UI framework for Havok Vision / Project Anarchy.
FairyGUI Vision SDK
====

A flexible UI framework for Havok Vision(Project Anarchy), working with the FREE professional Game UI Editor: FairyGUI Editor.
Download the editor from here: [www.fairygui.com](http://en.fairygui.com/product)

![](http://www.fairygui.com/images/20180109104718.png)

![](http://www.fairygui.com/images/20180109104733.png)

![](http://www.fairygui.com/images/20180109104759.png)

Features
====

* WYSIWYG. Easy to use, and habits consistent with the Adobe series of software, planning and art designers can easily get started.

* In the editor can be combined with a variety of complex UI components, no need to write code. No programmers need to extend the UI component.

* Support for translation, zoom, rotation, tilt, flip and other conventional 2D transform.

* Powerful text controls. Support for dynamic fonts, bitmap fonts, and external tools (such as BMFont, etc.) produced by the bitmap fonts, while supporting HTML syntax and UBB syntax to support complex graphics mixed. The input text supports the direct input of the IOS native expression. Support the font of the stroke effect, shadow effects, support for gradient text.

* A powerful list of controls that support horizontal, vertical, mobile, paging and other layouts, support for virtual lists and loop lists, even if the list of items is also large to reject the cardton. The virtual list also supports advanced features such as high ITEM, multiple ITEM resource blending. Support for advanced list controls such as tables, trees, and so on. Support close, paging and other advanced features.

* Support picture of Jiugongge and tiling treatment, support Jiugongge within the palace grid tiling treatment. Supports picture discoloration and grayscale.

* Support for basic drawing functions such as rectangles, circles, polygons, and so on.

* Supports sequence frame animation editing and use. Comes with a sequence frame animation editor, also supports the import of Flash CS, Animate CC and other tools produced animation.

* Built-in sweep, pinch, twist, long press and other commonly used gestures support. Built-in joystick support.

* Editor provides timeline design UI dynamic, you can combine transparency, location, size, color and other properties of more than a dozen animation. And real-time to see the effect of each frame. Support for inserting sound. Support nested dynamic effects.

* Support for rectangular masks and custom graphics masks.

* Support for color, blur and other filters. Support BlendMode settings.

* Support for pixel-by-pixel detection.

* Supports binding of UI components to any model, such as implementing a surface UI.

* Built-in text typing effect.

* Built-in window manager, pop-up window manager, drag and drop manager.

* Supports event bubbling mechanisms.

* Encapsulates all the underlying details of the input method, whether it is mouse input, single touch input, multi-touch input, VR input, you only need to use the same event listening mode to handle UI interaction.

* Support in the UI layer to insert any 3D objects, such as models, particles, skeleton animation, etc., automatically handle the rendering order.

* Edit the use of decentralized material, published automatically packaged atlas. Support the definition of multiple Atlas, Unity version automatically supports the extraction of A channel compression.

* Multi-language switching support. You can switch UI language in real time.

* Various resolution adaptive. A set of UIs for different resolution devices.

* Support for automatically generating code for editor components.

* Provide plug-in mechanism, according to the needs of the project for the editor to add personality features.

* Support design function, directly to the design shown in the background, easy to control the precise splicing.
24 changes: 24 additions & 0 deletions Source/FairyGUIApp/BagScene.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include "BagScene.h"

BagScene::BagScene() :_bagWindow(nullptr)
{
}

BagScene::~BagScene()
{
CC_SAFE_RELEASE(_bagWindow);
}

void BagScene::continueInit()
{
UIPackage::addPackage("UI/Bag");
UIConfig::horizontalScrollBar = "";
UIConfig::verticalScrollBar = "";

_view = UIPackage::createObject("Bag", "Main")->as<GComponent>();
_groot->addChild(_view);

_bagWindow = BagWindow::create();
_bagWindow->retain();
_view->getChild("bagBtn")->addClickListener([this](EventContext*) { _bagWindow->show(); });
}
27 changes: 27 additions & 0 deletions Source/FairyGUIApp/BagScene.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#ifndef __BAG_SCENE_H__
#define __BAG_SCENE_H__


#include "DemoScene.h"
#include "BagWindow.h"

USING_NS_FGUI;

class BagScene : public DemoScene
{
public:
BagScene();
~BagScene();

// implement the "static create()" method manually
CREATE_FUNC(BagScene);

protected:
virtual void continueInit() override;

private:
GComponent* _view;
BagWindow* _bagWindow;
};

#endif
43 changes: 43 additions & 0 deletions Source/FairyGUIApp/BagWindow.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#include "BagWindow.h"

void BagWindow::onInit()
{
setContentPane(UIPackage::createObject("Bag", "BagWin")->as<GComponent>());
center();
setModal(true);

_list = _contentPane->getChild("list")->as<GList>();
_list->addListener(UIEventType::ClickItem, CALLBACK_1(BagWindow::onClickItem, this));
_list->itemRenderer = CALLBACK_2(BagWindow::renderListItem, this);
_list->setNumItems(45);
}

void BagWindow::renderListItem(int index, GObject* obj)
{
obj->setIcon("icons/i" + Value((int)(rand_0_1() * 10)).asString() + ".png");
obj->setText(Value((int)(rand_0_1() * 100)).asString());
}

void BagWindow::doShowAnimation()
{
setScale(0.1f, 0.1f);
setPivot(0.5f, 0.5f);

ActionInterval* action = ActionFloat2::create(0.3f, getScale(), hkvVec2(1, 1), CALLBACK_2(BagWindow::setScale, this));
action = ActionUtils::composeActions(action, tweenfunc::Quad_EaseOut, 0, CALLBACK_0(BagWindow::onShown, this));
runAction(action);
}

void BagWindow::doHideAnimation()
{
ActionInterval* action = ActionFloat2::create(0.3f, getScale(), hkvVec2(0.1f, 0.1f), CALLBACK_2(BagWindow::setScale, this));
action = ActionUtils::composeActions(action, tweenfunc::Quad_EaseOut, 0, CALLBACK_0(BagWindow::hideImmediately, this));
runAction(action);
}

void BagWindow::onClickItem(EventContext* context)
{
GObject* item = (GObject*)context->getData();
_contentPane->getChild("n11")->setIcon(item->getIcon());
_contentPane->getChild("n13")->setText(item->getText());
}
25 changes: 25 additions & 0 deletions Source/FairyGUIApp/BagWindow.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#ifndef __BAG_WINDOW_H__
#define __BAG_WINDOW_H__

#include "FairyGUI.h"

USING_NS_FGUI;

class BagWindow : public Window
{
public:
CREATE_FUNC(BagWindow);

protected:
virtual void onInit() override;
virtual void doShowAnimation() override;
virtual void doHideAnimation() override;

private:
void onClickItem(EventContext* context);
void renderListItem(int index, GObject* obj);

GList* _list;
};

#endif
Loading

0 comments on commit adde812

Please sign in to comment.