13.07.2015 Views

Mali GPU User Interface Engine Application Development Guide

Mali GPU User Interface Engine Application Development Guide

Mali GPU User Interface Engine Application Development Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Tutorial on the Lotion <strong>User</strong> <strong>Interface</strong> Classesif (state == StateCenteringTargetApplet){if (fabs(position-targetApplet) > 0.002f)velocity += ((targetApplet-position)*500.f-velocity)*0.1f;else state = StateBrowsing;velocity *= 0.65f;}else if (state == StateBrowsing){if (!isPressed){float closest = floorf(position+0.5f);velocity += (closest-position);}velocity *= 0.97f;}position += velocity * 0.001;simTime += 0.01f;}if (position < 0) position = 0;if (position > 16) position = 16;for (int i = 0; i < iconInstances.getSize(); i++){mat4 t;t = mat4::translation(int((-position+1)* 265.0f), 0, 0);if ((state == StateOpeningTargetApplet)||(state == StateAppletClosing)){float animTime = getTime()-openingStartTime;if (animTime > 0.6f){animTime = 0.6f;}if (state == StateAppletClosing){animTime = 0.6f-animTime;}}// Fade neighbour icons left/rightif (i < floorf(position+0.5f)){t = mat4::translation(-animTime*animTime*1500.0f, 0, 0) * t;}else if (i > floorf(position+0.5f)){t = mat4::translation(+animTime*animTime*1500.0f, 0, 0) * t;}}}iconInstances[i]->setTransform(t);iconTextInstances[i]->setTransform(t);void Blue::update(){onUpdate(this);if (currentApplet) currentApplet->update();}...ARM DUI 0527A-02a Copyright © 2010 ARM. All rights reserved. 5-35ID070710Non-Confidential - Draft - Beta

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!