axmol/core/2d/CCSprite.cpp

1716 lines
51 KiB
C++
Raw Normal View History

/****************************************************************************
Copyright (c) 2008-2010 Ricardo Quesada
Copyright (c) 2010-2012 cocos2d-x.org
Copyright (c) 2011 Zynga Inc.
Copyright (c) 2013-2016 Chukong Technologies Inc.
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
Copyright (c) 2020 C4games Ltd.
Copyright (c) 2021-2022 Bytedance Inc.
2022-10-01 16:24:52 +08:00
https://axmolengine.github.io/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "2d/CCSprite.h"
#include <algorithm>
2021-12-25 10:04:45 +08:00
#include <stddef.h> // offsetof
#include "base/ccTypes.h"
#include "2d/CCSpriteBatchNode.h"
2014-04-30 08:37:36 +08:00
#include "2d/CCAnimationCache.h"
#include "2d/CCSpriteFrame.h"
#include "2d/CCSpriteFrameCache.h"
Squashed commit of the following: commit a794d107ad85667e3d754f0b6251fc864dfbf288 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri May 16 14:33:49 2014 -0700 Yeah... everything compiles on win32 and wp8 commit 4740be6e4a0d16f742c27996e7ab2c100adc76af Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri May 16 13:58:38 2014 -0700 CCIME moved to base and compiles on Android commit ff3e1bf1eb27a01019f4e1b56d1aebbe2d385f72 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri May 16 13:02:57 2014 -0700 compiles Ok for Windows Phone 8 commit 8160a4eb2ecdc61b5bd1cf56b90d2da6f11e3ebd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri May 16 12:25:31 2014 -0700 fixes for Windows Phone 8 commit 418197649efc93032aee0adc205e502101cdb53d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri May 16 11:15:13 2014 -0700 Compiles on Win32 commit 08813ed7cf8ac1079ffadeb1ce78ea9e833e1a33 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri May 16 10:08:31 2014 -0700 Compiles on linux! commit 118896521e5b335a5257090b6863f1fb2a2002fe Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri May 16 09:30:42 2014 -0700 moves cocos/2d/platform -> cocos/platform commit 4fe9319d7717b0c1bccb2db0156eeb86255a89e0 Merge: bd68ec2 511295e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri May 16 08:24:41 2014 -0700 Merge remote-tracking branch 'cocos2d/v3' into files commit bd68ec2f0e3a826d8b2f4b60564ba65ce766bc56 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu May 15 19:36:23 2014 -0700 files in the correct directory
2014-05-17 05:36:00 +08:00
#include "renderer/CCTextureCache.h"
#include "renderer/CCTexture2D.h"
2014-05-10 09:39:25 +08:00
#include "renderer/CCRenderer.h"
2014-04-30 08:37:36 +08:00
#include "base/CCDirector.h"
#include "base/ccUTF8.h"
2015-07-30 11:53:23 +08:00
#include "2d/CCCamera.h"
metal support for cocos2d-x (#19305) * remove deprecated files * remove some deprecated codes * remove more deprecated codes * remove ui deprecated codes * remove more deprecated codes * remove deprecated codes in ccmenuitem * remove more deprecated codes in ui * remove more deprecated codes in ui * remove more deprecated codes in ui * remove more deprecated codes * remove more deprecated codes * remove more deprecated codes * remove vr related codes and ignore some modules * remove allocator * remove some config * 【Feature】add back-end project file * [Feature] add back-end file * add pipeline descriptor and shader cache * [Feature] support sprite for backend * [Feature] remove unneeded code * [Feature] according to es2.0 spec, you must use clamp-to-edge as texture wrap mode, and no mipmapping for non-power-of-two texture * [Feature] set texture wrap mode to clamp-to-edge, and no mipmapping for non-power-of-two texture * [Feature] remove macro define to .cpp file * [Feature] add log info * [Feature] add PipelineDescriptor for TriangleCommand * [Feature] add PipelineDescriptor object as member of TriangleCommand * [Feature] add getPipelineDescriptor method * add renderbackend * complete pipeline descriptor * [Feature] add viewport in RenderCommand * set viewport when rendrering * [Feature] occur error when using RendererBackend, to be fixed. * a workaround to fix black screen on macOS 10.14 (#19090) * add rendererbackend init function * fix typo * [Feature] modify testFile * [BugFix] modify shader path * [Feature] set default viewport * fix projection * [Feature] modify log info * [BugFix] change viewport data type to int * [BugFix] add BindGroup to PipelienDescriptor * [BugFix] change a_position to vec3 in sprite.vert * [BugFix] set vertexLayout according to V3F_C4B_T2F structure * [Feature] revert a_position to vec4 * [Feature] renderer should not use gl codes directly * [Feature] it's better not use default value parameter * fix depth test setting * rendererbackend -> renderer * clear color and depth at begin * add metal backend * metal support normalized attribute * simplify codes * update external * add render pass desctriptor in pipeline descriptor * fix warnings * fix crash and memeory leak * refactor Texture2D * put pipeline descriptor into render command * simplify codes * [Feature] update Sprite * fix crash when closing app * [Feature] update SpriteBatchNode and TextureAtlas * support render texture(not finish) * [Feature] remove unused code * make tests work on mac * fix download-deps path error * make tests work on iOS * [Feature] support ttf under normal label effect * refactor triangle command processing * let renderer handle more common commands * refactor backend * make render texture work * [Feature] refactor backend for GL * [Feature]Renaming to make it easy to understand * [Feature] change warp mode to CLAMP_TO_EDGE * fix ghost * simplify visit render queue logic * support progress timer without rial mode * support partcile system * Feature/update label (#149) * [BugFix] fix compile error * [Feature] support outline effect in ios * [Feature] add shader file * [BugFix] fix begin and end RenderPass * [Feature] update CustomCommand * [Feature] revert project.pbxproj * [Feature] simplify codes * [BugFix] pack AI88 to RGBA8888 only when outline enable * [Feature] support shadow effect in Label * [Feature] support BMFont * [Feature] support glow effect * [Feature] simplify shader files * LabelAtlas work * handle blend function correctly * support tile map * don't share buffer in metal * alloc buffer size as needed * support more tilemap * Merge branch 'minggo/metal-support' into feature/updateLabel * minggo/metal-support: support tile map handle blend function correctly LabelAtlas work Feature/update label (#149) support partcile system # Conflicts: # cocos/2d/CCLabel.cpp # cocos/2d/CCSprite.cpp # cocos/2d/CCSpriteBatchNode.cpp # cocos/renderer/CCQuadCommand.cpp # cocos/renderer/CCQuadCommand.h * render texture work without saving file * use global viewport * grid3d works * remove grabber * tiled3d works * [BugFix] fix label bug * [Feature] add updateSubData for buffer * [Feature] remove setVertexCount * support depth test * add callback command * [Feature] add UITest * [Feature] update UITest * [Feature] remove unneeded codes * fix custom command issue * fix layer color blend issue * [BugFix] fix iOS compile error * [Feature] remove unneeded codes * [Feature] fix updateVertexBuffer * layerradial works * add draw test back * fix batch issue * fix compiling error * [BugFix] support ETC1 * [BugFix] get the correct pipelineDescriptor * [BugFix] skip draw when backendTexture nullptr * clipping node support * [Feature] add shader files * fix stencil issue in metal * [Feature] update UILayoutTest * [BugFix] skip drawing when vertexCount is zero * refactor renderer * add set global z order for stencil manager commands * fix warnings caused by type * remove viewport in render command * [Feature] fix warnings caused by type * [BugFix] clear vertexCount and indexCount for CustomComand when needed * [Feature] update clear for CustomCommand * ios use metal * fix viewport issue * fix LayerColorGradient crash * [cmake] transport to android and windows (#160) * save point 1 * compile on windows * run on android * revert useless change * android set CC_ENABLE_CACHE_TEXTURE_DATA to 1 * add initGlew * fix android crash * add TODO new-renderer * review update * revert onGLFWWindowPosCallback * fix android compiling error * Impl progress radial (#162) * progresstimer add radial impl * default drawType to element * dec invoke times of createVertexBuffer (#163) * support depth/stencil format for gl backend * simplify progress timer codes * support motionstreak, effect is wrong * fix motionstreak issue * [Feature] update Scissor Test (#161) * [Feature] update Scissor Test * [Feature] update ScissorTest * [Feature] rename function * [Feature] get constant reference if needed * [Feature] show render status (#164) * improve performance * fix depth state * fill error that triangle vertex/index number bigger than buffer * fix compiline error in release mode * fix buffer conflict between CPU and GPU on iOS/macOS * Renderer refactor (#165) * use one vertes/index buffer with opengl * fix error on windows * custom command support index format config * CCLayer: compact vertex data structure * update comment * fix doc * support fast tilemap * pass index format instead * fix some wrong effect * fix render texture error * fix texture per-element size * fix texture format error * BlendFunc type refactor, GLenum -> backend::BlendFactor (#167) * BlendFunc use backend::BlendFactor as inner field * update comments * use int to replace GLenum * update xcode project fiel * rename to GLBlendConst * add ccConstants.h * update xcode project file * update copyright * remove primitive command * remove CCPrimitive.cpp/.h * remove deprecated files * remove unneeded files * remove multiple view support * remove multiple view support * remove the usage of frame buffer in camera * director don't use frame buffer * remove FrameBuffer * remove BatchCommand * add some api reference * add physics2d back * fix crash when close app on mac * improve render texture * fix rendertexture issue * fix rendertexture issue * simplify codes * CMake support for mac & ios (#169) * update cmake * fix compile error * update 3rd libs version * remove CCThread.h/.cpp * remove ccthread * use audio engine to implement simple audio engine * remove unneeded codes * remove deprecated codes * remove winrt macro * remove CC_USE_WIC * set partcile blend function in more elegant way * remove unneeded codes * remove unneeded codes * cmake works on windows * update project setting * improve performance * GLFloat -> float * sync v3 cmake improvements into metal-support (#172) * pick: modern cmake, compile definitions improvement (#19139) * modern cmake, use target_compile_definitions partly * simplify macro define, remove USE_* * modern cmake, macro define * add physics 2d macro define into ccConfig.h * remove USE_CHIPMUNK macro in build.gradle * remove CocosSelectModule.cmake * shrink useless define * simplify compile options config, re-add if necessary * update external for tmp CI test * un-quote target_compile_options value * add "-g" parameter only when debug mode * keep single build type when generator Xcode & VS projecy * update external for tmp CI tes * add static_cast<char>(-1), fix -Wc++11-narrowing * simplify win32 compile define * not modify code, only improve compile options # Conflicts: # .gitignore # cmake/Modules/CocosConfigDepend.cmake # cocos/CMakeLists.txt # external/config.json # tests/cpp-tests/CMakeLists.txt * modern cmake, improve cmake_compiler_flags (#19145) * cmake_compiler_flags * Fix typo * Fix typo2 * Remove chanages from Android.mk * correct lua template cmake build (#19149) * don't add -Wno-deprecated into jsb target * correct lua template cmake build * fix win32 lua template compile error * prevent cmake in-source-build friendly (#19151) * pick: Copy resources to "Resources/" on win32 like in linux configuration * add "/Z7" for cpp-tests on windows * [cmake] fix iOS xcode property setting failed (#19208) * fix iOS xcode property setting failed * use search_depend_libs_recursive at dlls collect * fix typo * [cmake] add find_host_library into iOS toolchain file (#19230) * pick: [lua android] use luajit & template cmake update (#19239) * increase cmake stability , remove tests/CMakeLists.txt (#19261) * cmake win32 Precompiled header (#19273) * Precompiled header * Fix * Precompiled header for cocos * Precompiled header jscocos2d * Fix for COCOS2D_DEBUG is always 1 on Android (#19291) Related #19289 * little build fix, tests cpp-tests works on mac * sync v3 build related codes into metal-support (#173) * strict initialization for std::array * remove proj.win32 project configs * modern cmake, cmake_cleanup_remove_unused_variables (#19146) * Switch travis CI to xenial (#19207) * Switch travis CI to xenial * Remove language: android * Set language: cpp * Fix java problem * Update sdkmanager * Fix sdkmanger * next sdkmanager fix * Remove xenial from android * revert to sdk-tools-{system}-3859397 * Remove linux cmake install * Update before-install.sh * Update .travis.yml * Simplify install-deps-linux.sh, tested on Ubuntu 16.04 (#19212) * Simplify install-deps-linux.sh * Cleanup * pick: install ninja * update cocos2d-console submodule * for metal-support alpha release, we only test cpp * add HelloCpp into project(Cocos2d-x) for tmp test * update extenal metal-support-4 * update uniform setting * [Feature] update BindGroup * [Feature] empty-test * [Feature] cpp-test * [Feature] fix GL compiler error * [Feature] fix GL crash * [Feature] empty-test * [Feature] cpp-tests * [feature] improve frameRate * [feature] fix opengl compile error * [feature] fix opengl compile error * [BugFix] fix compute maxLocation error * [Feature] update setting unifrom * [Feature] fix namespace * [Feature] remove unneeded code * [Bugfix] fix project file * [Feature] update review * [texture2d] impl texture format support (#175) * texture update * update * update texture * commit * compile on windows * ddd * rename * rename methods * no crash * save gl * save * save * rename * move out pixel format convert functions * metal crash * update * update android * support gles compressed texture format * support more compress format * add more conversion methods * ss * save * update conversion methods * add PVRTC format support * reformat * add marco linux * fix GL marcro * pvrtc supported only by ios 8.0+ * remove unused cmake * revert change * refactor Texture2D::initWithData * fix conversion log * refactor Texture2D::initWithData * remove some OpenGL constants for PVRTC * add todo * fix typo * AutoTest works on mac/iOS by disable part cases, sync v3 bug fix (#174) * review cpp-tests, and fix part issues on start auto test * sync png format fix: Node:Particle3D abnormal texture effects #19204 * fix cpp-tests SpritePolygon crash, wrong png format (#19170) * fix wrong png convert format from sRGB to Gray * erase plist index if all frames was erased * test_A8.png have I8 format, fix it * [CCSpriteCache] allow re-add plist & add testcase (#19175) * allow re-add plist & add testcase * remove comments/rename method/update testcase * fix isSpriteFramesWithFileLoaded & add testcase * remove used variable * remove unused variable * fix double free issues when js/lua-tests exit on iOS (#19236) * disable part cases, AutoTest works without crash on mac * update cocos2dx files json, to test cocos new next * fix spritecache plist parsing issue (#19269) * [linux] Fix FileUtils::getContents with folder (#19157) * fix FileUtils::getContents on linux/mac * use stat.st_mode * simplify * [CCFileUtils] win32 getFileSize (#19176) * win32 getFileSize * fix stat * [cpp test-Android]20:FileUtils/2 change title (#19197) * sync #19200 * sync #19231 * [android lua] improve performance of lua loader (#19234) * [lua] improve performance of lua loader * remove cache fix * Revert "fix spritecache plist parsing issue (#19269)" This reverts commit f3a85ece4307a7b90816c34489d1ed2c8fd11baf. * remove win32 project files ref in template.json * add metal framework lnk ref into cpp template * test on iOS, and disable part cases * alBufferData instead of alBufferDataStatic for small audio file on Apple (#19227) * changes AudioCache to use alBufferData instead of alBufferDataStatic (also makes test 19 faster to trigger openal bugs faster) The original problem: CrashIfClientProvidedBogusAudioBufferList https://github.com/cocos2d/cocos2d-x/issues/18948 is not happening anymore, but there's still a not very frequent issue that makes OpenAL crash with a call stack like this. AudioCache::readDataTask > alBufferData > CleanUpDeadBufferList It happes more frequently when the device is "cold", which means after half an hour of not using the device (locked). I could not find the actual source code for iOS OpenAL, so I used the macOS versions: https://opensource.apple.com/source/OpenAL/OpenAL-48.7/Source/OpenAL/oalImp.cpp.auto.html They seem to use CAGuard.h to make sure the dead buffer list has no threading issues. I'm worried because the CAGuard code I found has macos and win32 define but no iOS, so I'm not sure. I guess the iOS version is different and has the guard. I could not find a place in the code that's unprotected by the locks except the InitializeBufferMap() which should not be called more than once from cocos, and there's a workaround in AudioEngine-impl for it. I reduced the occurence of the CleanUpDeadBufferList crash by moving the guard in ~AudioCache to cover the alDeleteBuffers call. * remove hack method "setTimeout" on audio * AutoTest works on iOS * support set ios deployment target for root project * enable all texture2d cases, since Jiang have fixed * add CCTextureUtils to xcode project file (#176) * add leak cases for SpriteFrameCache (#177) * re-add SpriteFrameCache cases * update template file json * Update SpriteFrameCacheTest.cpp * fix compiling error
2019-01-18 15:08:25 +08:00
#include "platform/CCFileUtils.h"
#include "renderer/ccShaders.h"
#include "renderer/backend/ProgramState.h"
#include "renderer/backend/Device.h"
NS_AX_BEGIN
// MARK: create, init, dealloc
2021-12-25 10:04:45 +08:00
Sprite* Sprite::createWithTexture(Texture2D* texture)
{
2021-12-25 10:04:45 +08:00
Sprite* sprite = new Sprite();
2021-12-08 00:11:53 +08:00
if (sprite->initWithTexture(texture))
{
sprite->autorelease();
return sprite;
}
2022-07-15 19:17:01 +08:00
AX_SAFE_DELETE(sprite);
return nullptr;
}
2021-12-25 10:04:45 +08:00
Sprite* Sprite::createWithTexture(Texture2D* texture, const Rect& rect, bool rotated)
{
2021-12-25 10:04:45 +08:00
Sprite* sprite = new Sprite();
2021-12-08 00:11:53 +08:00
if (sprite->initWithTexture(texture, rect, rotated))
{
sprite->autorelease();
return sprite;
}
2022-07-15 19:17:01 +08:00
AX_SAFE_DELETE(sprite);
return nullptr;
}
2021-12-26 23:26:34 +08:00
Sprite* Sprite::create(std::string_view filename)
{
return Sprite::create(filename, Texture2D::getDefaultAlphaPixelFormat());
}
Sprite* Sprite::create(std::string_view filename, PixelFormat format)
{
2021-12-25 10:04:45 +08:00
Sprite* sprite = new Sprite();
if (sprite->initWithFile(filename, format))
{
sprite->autorelease();
return sprite;
}
2022-07-15 19:17:01 +08:00
AX_SAFE_DELETE(sprite);
return nullptr;
}
Sprite* Sprite::create(const PolygonInfo& info)
{
2021-12-25 10:04:45 +08:00
Sprite* sprite = new Sprite();
if (sprite->initWithPolygon(info))
{
sprite->autorelease();
return sprite;
}
2022-07-15 19:17:01 +08:00
AX_SAFE_DELETE(sprite);
return nullptr;
}
2021-12-26 23:26:34 +08:00
Sprite* Sprite::create(std::string_view filename, const Rect& rect)
{
2021-12-25 10:04:45 +08:00
Sprite* sprite = new Sprite();
2021-12-08 00:11:53 +08:00
if (sprite->initWithFile(filename, rect))
{
sprite->autorelease();
return sprite;
}
2022-07-15 19:17:01 +08:00
AX_SAFE_DELETE(sprite);
return nullptr;
}
2021-12-25 10:04:45 +08:00
Sprite* Sprite::createWithSpriteFrame(SpriteFrame* spriteFrame)
{
2021-12-25 10:04:45 +08:00
Sprite* sprite = new Sprite();
2021-12-08 00:11:53 +08:00
if (spriteFrame && sprite->initWithSpriteFrame(spriteFrame))
{
sprite->autorelease();
return sprite;
}
2022-07-15 19:17:01 +08:00
AX_SAFE_DELETE(sprite);
return nullptr;
}
2021-12-26 23:26:34 +08:00
Sprite* Sprite::createWithSpriteFrameName(std::string_view spriteFrameName)
{
2021-12-25 10:04:45 +08:00
SpriteFrame* frame = SpriteFrameCache::getInstance()->getSpriteFrameByName(spriteFrameName);
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
2022-08-08 18:02:17 +08:00
#if _AX_DEBUG > 0
char msg[256] = {0};
2021-12-26 23:26:34 +08:00
sprintf(msg, "Invalid spriteFrameName: %s", spriteFrameName.data());
2022-07-16 10:43:05 +08:00
AXASSERT(frame != nullptr, msg);
#endif
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
return createWithSpriteFrame(frame);
}
Sprite* Sprite::create()
{
2021-12-25 10:04:45 +08:00
Sprite* sprite = new Sprite();
2021-12-08 00:11:53 +08:00
if (sprite->init())
{
sprite->autorelease();
return sprite;
}
2022-07-15 19:17:01 +08:00
AX_SAFE_DELETE(sprite);
return nullptr;
}
2015-12-16 11:53:59 +08:00
bool Sprite::init()
{
2015-12-16 11:53:59 +08:00
initWithTexture(nullptr, Rect::ZERO);
return true;
}
2021-12-25 10:04:45 +08:00
bool Sprite::initWithTexture(Texture2D* texture)
{
2022-07-16 10:43:05 +08:00
AXASSERT(texture != nullptr, "Invalid texture for sprite");
Rect rect = Rect::ZERO;
if (texture)
2015-12-16 11:53:59 +08:00
rect.size = texture->getContentSize();
2015-12-16 11:53:59 +08:00
return initWithTexture(texture, rect, false);
}
2021-12-25 10:04:45 +08:00
bool Sprite::initWithTexture(Texture2D* texture, const Rect& rect)
{
return initWithTexture(texture, rect, false);
}
2021-12-26 23:26:34 +08:00
bool Sprite::initWithFile(std::string_view filename)
{
return initWithFile(filename, Texture2D::getDefaultAlphaPixelFormat());
}
bool Sprite::initWithFile(std::string_view filename, PixelFormat format)
{
if (filename.empty())
{
2022-07-16 10:43:05 +08:00
AXLOG("Call Sprite::initWithFile with blank resource filename.");
return false;
}
_fileName = filename;
Texture2D* texture = _director->getTextureCache()->addImage(filename, format);
if (texture)
{
Rect rect = Rect::ZERO;
rect.size = texture->getContentSize();
return initWithTexture(texture, rect);
}
// don't release here.
// when load texture failed, it's better to get a "transparent" sprite then a crashed program
// this->release();
return false;
}
2021-12-26 23:26:34 +08:00
bool Sprite::initWithFile(std::string_view filename, const Rect& rect)
{
2022-07-16 10:43:05 +08:00
AXASSERT(!filename.empty(), "Invalid filename");
2015-12-16 11:53:59 +08:00
if (filename.empty())
return false;
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
_fileName = filename;
2021-12-25 10:04:45 +08:00
Texture2D* texture = _director->getTextureCache()->addImage(filename);
if (texture)
return initWithTexture(texture, rect);
// don't release here.
// when load texture failed, it's better to get a "transparent" sprite then a crashed program
// this->release();
return false;
}
2021-12-26 23:26:34 +08:00
bool Sprite::initWithSpriteFrameName(std::string_view spriteFrameName)
{
2022-07-16 10:43:05 +08:00
AXASSERT(!spriteFrameName.empty(), "Invalid spriteFrameName");
2015-12-16 11:53:59 +08:00
if (spriteFrameName.empty())
return false;
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
_fileName = spriteFrameName;
_fileType = 1;
2021-12-25 10:04:45 +08:00
SpriteFrame* frame = SpriteFrameCache::getInstance()->getSpriteFrameByName(spriteFrameName);
return initWithSpriteFrame(frame);
}
2021-12-25 10:04:45 +08:00
bool Sprite::initWithSpriteFrame(SpriteFrame* spriteFrame)
{
2022-07-16 10:43:05 +08:00
AXASSERT(spriteFrame != nullptr, "spriteFrame can't be nullptr!");
2015-12-16 11:53:59 +08:00
if (spriteFrame == nullptr)
return false;
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
bool ret = initWithTexture(spriteFrame->getTexture(), spriteFrame->getRect(), spriteFrame->isRotated());
setSpriteFrame(spriteFrame);
return ret;
}
2022-08-08 18:02:17 +08:00
bool Sprite::initWithPolygon(const ax::PolygonInfo& info)
{
2015-12-16 11:53:59 +08:00
bool ret = false;
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
2021-12-25 10:04:45 +08:00
Texture2D* texture = _director->getTextureCache()->addImage(info.getFilename());
if (texture && initWithTexture(texture))
2015-06-04 15:43:31 +08:00
{
2021-12-25 10:04:45 +08:00
_polyInfo = info;
_renderMode = RenderMode::POLYGON;
Node::setContentSize(_polyInfo.getRect().size / _director->getContentScaleFactor());
2015-12-16 11:53:59 +08:00
ret = true;
2015-06-04 15:43:31 +08:00
}
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
2015-12-16 11:53:59 +08:00
return ret;
}
// designated initializer
2021-12-25 10:04:45 +08:00
bool Sprite::initWithTexture(Texture2D* texture, const Rect& rect, bool rotated)
{
2015-12-16 11:53:59 +08:00
bool result = false;
if (Node::init())
{
_batchNode = nullptr;
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
_recursiveDirty = false;
setDirty(false);
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
_flippedX = _flippedY = false;
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
// default transform anchor: center
setAnchorPoint(Vec2::ANCHOR_MIDDLE);
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
// zwoptex default values
_offsetPosition.setZero();
// clean the Quad
memset(&_quad, 0, sizeof(_quad));
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
// Atlas: Color
_quad.bl.colors = Color4B::WHITE;
_quad.br.colors = Color4B::WHITE;
_quad.tl.colors = Color4B::WHITE;
_quad.tr.colors = Color4B::WHITE;
2014-05-10 09:39:25 +08:00
// update texture (calls updateBlendFunc)
setTexture(texture);
2021-08-29 08:06:38 +08:00
setTextureRect(rect, rotated, rect.size);
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
// by default use "Self Render".
// if the sprite is added to a batchnode, then it will automatically switch to "batchnode Render"
setBatchNode(nullptr);
result = true;
}
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
_recursiveDirty = true;
setDirty(true);
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
return result;
}
2018-05-14 10:34:56 +08:00
Sprite::Sprite()
{
2022-07-15 19:17:01 +08:00
#if AX_SPRITE_DEBUG_DRAW
2015-08-26 18:14:25 +08:00
_debugDrawNode = DrawNode::create();
addChild(_debugDrawNode);
2022-07-15 19:17:01 +08:00
#endif // AX_SPRITE_DEBUG_DRAW
}
Sprite::~Sprite()
{
2022-07-15 19:17:01 +08:00
AX_SAFE_FREE(_trianglesVertex);
AX_SAFE_FREE(_trianglesIndex);
AX_SAFE_RELEASE(_spriteFrame);
AX_SAFE_RELEASE(_texture);
}
/*
* Texture methods
*/
/*
* This array is the data of a white image with 2 by 2 dimension.
* It's used for creating a default texture when sprite's texture is set to nullptr.
* Supposing codes as follows:
*
2021-12-08 00:11:53 +08:00
* auto sp = new Sprite();
2021-12-25 10:04:45 +08:00
* sp->init(); // Texture was set to nullptr, in order to make opacity and color to work correctly, we need to create
* a 2x2 white texture.
*
* The test is in "TestCpp/SpriteTest/Sprite without texture".
*/
static unsigned char cc_2x2_white_image[] = {
// RGBA8888
2021-12-25 10:04:45 +08:00
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
2022-07-15 19:17:01 +08:00
#define AX_2x2_WHITE_IMAGE_KEY "/cc_2x2_white_image"
2013-11-14 07:55:36 +08:00
// MARK: texture
2021-12-26 23:26:34 +08:00
void Sprite::setTexture(std::string_view filename)
2013-11-14 07:55:36 +08:00
{
2021-12-25 10:04:45 +08:00
Texture2D* texture = _director->getTextureCache()->addImage(filename);
2013-11-14 07:55:36 +08:00
setTexture(texture);
_unflippedOffsetPositionFromCenter = Vec2::ZERO;
2021-12-25 10:04:45 +08:00
Rect rect = Rect::ZERO;
if (texture)
rect.size = texture->getContentSize();
setTextureRect(rect);
}
void Sprite::setVertexLayout()
{
AXASSERT(_programState, "programState should not be nullptr");
_programState->validateSharedVertexLayout(VertexLayoutHelper::setupSprite);
}
void Sprite::setProgramState(uint32_t type)
{
setProgramStateWithRegistry(type, _texture);
}
2021-12-25 10:04:45 +08:00
bool Sprite::setProgramState(backend::ProgramState* programState, bool needsRetain)
2019-03-14 13:43:40 +08:00
{
2022-07-16 10:43:05 +08:00
AXASSERT(programState, "argument should not be nullptr");
2021-12-25 10:04:45 +08:00
if (Node::setProgramState(programState, needsRetain))
{
auto& pipelineDescriptor = _trianglesCommand.getPipelineDescriptor();
2020-09-09 13:03:31 +08:00
pipelineDescriptor.programState = _programState;
2019-03-14 13:43:40 +08:00
2020-09-09 13:03:31 +08:00
_mvpMatrixLocation = _programState->getUniformLocation(backend::Uniform::MVP_MATRIX);
2019-03-14 13:43:40 +08:00
setVertexLayout();
2020-09-09 13:03:31 +08:00
updateProgramStateTexture(_texture);
setMVPMatrixUniform();
return true;
}
return false;
metal support for cocos2d-x (#19305) * remove deprecated files * remove some deprecated codes * remove more deprecated codes * remove ui deprecated codes * remove more deprecated codes * remove deprecated codes in ccmenuitem * remove more deprecated codes in ui * remove more deprecated codes in ui * remove more deprecated codes in ui * remove more deprecated codes * remove more deprecated codes * remove more deprecated codes * remove vr related codes and ignore some modules * remove allocator * remove some config * 【Feature】add back-end project file * [Feature] add back-end file * add pipeline descriptor and shader cache * [Feature] support sprite for backend * [Feature] remove unneeded code * [Feature] according to es2.0 spec, you must use clamp-to-edge as texture wrap mode, and no mipmapping for non-power-of-two texture * [Feature] set texture wrap mode to clamp-to-edge, and no mipmapping for non-power-of-two texture * [Feature] remove macro define to .cpp file * [Feature] add log info * [Feature] add PipelineDescriptor for TriangleCommand * [Feature] add PipelineDescriptor object as member of TriangleCommand * [Feature] add getPipelineDescriptor method * add renderbackend * complete pipeline descriptor * [Feature] add viewport in RenderCommand * set viewport when rendrering * [Feature] occur error when using RendererBackend, to be fixed. * a workaround to fix black screen on macOS 10.14 (#19090) * add rendererbackend init function * fix typo * [Feature] modify testFile * [BugFix] modify shader path * [Feature] set default viewport * fix projection * [Feature] modify log info * [BugFix] change viewport data type to int * [BugFix] add BindGroup to PipelienDescriptor * [BugFix] change a_position to vec3 in sprite.vert * [BugFix] set vertexLayout according to V3F_C4B_T2F structure * [Feature] revert a_position to vec4 * [Feature] renderer should not use gl codes directly * [Feature] it's better not use default value parameter * fix depth test setting * rendererbackend -> renderer * clear color and depth at begin * add metal backend * metal support normalized attribute * simplify codes * update external * add render pass desctriptor in pipeline descriptor * fix warnings * fix crash and memeory leak * refactor Texture2D * put pipeline descriptor into render command * simplify codes * [Feature] update Sprite * fix crash when closing app * [Feature] update SpriteBatchNode and TextureAtlas * support render texture(not finish) * [Feature] remove unused code * make tests work on mac * fix download-deps path error * make tests work on iOS * [Feature] support ttf under normal label effect * refactor triangle command processing * let renderer handle more common commands * refactor backend * make render texture work * [Feature] refactor backend for GL * [Feature]Renaming to make it easy to understand * [Feature] change warp mode to CLAMP_TO_EDGE * fix ghost * simplify visit render queue logic * support progress timer without rial mode * support partcile system * Feature/update label (#149) * [BugFix] fix compile error * [Feature] support outline effect in ios * [Feature] add shader file * [BugFix] fix begin and end RenderPass * [Feature] update CustomCommand * [Feature] revert project.pbxproj * [Feature] simplify codes * [BugFix] pack AI88 to RGBA8888 only when outline enable * [Feature] support shadow effect in Label * [Feature] support BMFont * [Feature] support glow effect * [Feature] simplify shader files * LabelAtlas work * handle blend function correctly * support tile map * don't share buffer in metal * alloc buffer size as needed * support more tilemap * Merge branch 'minggo/metal-support' into feature/updateLabel * minggo/metal-support: support tile map handle blend function correctly LabelAtlas work Feature/update label (#149) support partcile system # Conflicts: # cocos/2d/CCLabel.cpp # cocos/2d/CCSprite.cpp # cocos/2d/CCSpriteBatchNode.cpp # cocos/renderer/CCQuadCommand.cpp # cocos/renderer/CCQuadCommand.h * render texture work without saving file * use global viewport * grid3d works * remove grabber * tiled3d works * [BugFix] fix label bug * [Feature] add updateSubData for buffer * [Feature] remove setVertexCount * support depth test * add callback command * [Feature] add UITest * [Feature] update UITest * [Feature] remove unneeded codes * fix custom command issue * fix layer color blend issue * [BugFix] fix iOS compile error * [Feature] remove unneeded codes * [Feature] fix updateVertexBuffer * layerradial works * add draw test back * fix batch issue * fix compiling error * [BugFix] support ETC1 * [BugFix] get the correct pipelineDescriptor * [BugFix] skip draw when backendTexture nullptr * clipping node support * [Feature] add shader files * fix stencil issue in metal * [Feature] update UILayoutTest * [BugFix] skip drawing when vertexCount is zero * refactor renderer * add set global z order for stencil manager commands * fix warnings caused by type * remove viewport in render command * [Feature] fix warnings caused by type * [BugFix] clear vertexCount and indexCount for CustomComand when needed * [Feature] update clear for CustomCommand * ios use metal * fix viewport issue * fix LayerColorGradient crash * [cmake] transport to android and windows (#160) * save point 1 * compile on windows * run on android * revert useless change * android set CC_ENABLE_CACHE_TEXTURE_DATA to 1 * add initGlew * fix android crash * add TODO new-renderer * review update * revert onGLFWWindowPosCallback * fix android compiling error * Impl progress radial (#162) * progresstimer add radial impl * default drawType to element * dec invoke times of createVertexBuffer (#163) * support depth/stencil format for gl backend * simplify progress timer codes * support motionstreak, effect is wrong * fix motionstreak issue * [Feature] update Scissor Test (#161) * [Feature] update Scissor Test * [Feature] update ScissorTest * [Feature] rename function * [Feature] get constant reference if needed * [Feature] show render status (#164) * improve performance * fix depth state * fill error that triangle vertex/index number bigger than buffer * fix compiline error in release mode * fix buffer conflict between CPU and GPU on iOS/macOS * Renderer refactor (#165) * use one vertes/index buffer with opengl * fix error on windows * custom command support index format config * CCLayer: compact vertex data structure * update comment * fix doc * support fast tilemap * pass index format instead * fix some wrong effect * fix render texture error * fix texture per-element size * fix texture format error * BlendFunc type refactor, GLenum -> backend::BlendFactor (#167) * BlendFunc use backend::BlendFactor as inner field * update comments * use int to replace GLenum * update xcode project fiel * rename to GLBlendConst * add ccConstants.h * update xcode project file * update copyright * remove primitive command * remove CCPrimitive.cpp/.h * remove deprecated files * remove unneeded files * remove multiple view support * remove multiple view support * remove the usage of frame buffer in camera * director don't use frame buffer * remove FrameBuffer * remove BatchCommand * add some api reference * add physics2d back * fix crash when close app on mac * improve render texture * fix rendertexture issue * fix rendertexture issue * simplify codes * CMake support for mac & ios (#169) * update cmake * fix compile error * update 3rd libs version * remove CCThread.h/.cpp * remove ccthread * use audio engine to implement simple audio engine * remove unneeded codes * remove deprecated codes * remove winrt macro * remove CC_USE_WIC * set partcile blend function in more elegant way * remove unneeded codes * remove unneeded codes * cmake works on windows * update project setting * improve performance * GLFloat -> float * sync v3 cmake improvements into metal-support (#172) * pick: modern cmake, compile definitions improvement (#19139) * modern cmake, use target_compile_definitions partly * simplify macro define, remove USE_* * modern cmake, macro define * add physics 2d macro define into ccConfig.h * remove USE_CHIPMUNK macro in build.gradle * remove CocosSelectModule.cmake * shrink useless define * simplify compile options config, re-add if necessary * update external for tmp CI test * un-quote target_compile_options value * add "-g" parameter only when debug mode * keep single build type when generator Xcode & VS projecy * update external for tmp CI tes * add static_cast<char>(-1), fix -Wc++11-narrowing * simplify win32 compile define * not modify code, only improve compile options # Conflicts: # .gitignore # cmake/Modules/CocosConfigDepend.cmake # cocos/CMakeLists.txt # external/config.json # tests/cpp-tests/CMakeLists.txt * modern cmake, improve cmake_compiler_flags (#19145) * cmake_compiler_flags * Fix typo * Fix typo2 * Remove chanages from Android.mk * correct lua template cmake build (#19149) * don't add -Wno-deprecated into jsb target * correct lua template cmake build * fix win32 lua template compile error * prevent cmake in-source-build friendly (#19151) * pick: Copy resources to "Resources/" on win32 like in linux configuration * add "/Z7" for cpp-tests on windows * [cmake] fix iOS xcode property setting failed (#19208) * fix iOS xcode property setting failed * use search_depend_libs_recursive at dlls collect * fix typo * [cmake] add find_host_library into iOS toolchain file (#19230) * pick: [lua android] use luajit & template cmake update (#19239) * increase cmake stability , remove tests/CMakeLists.txt (#19261) * cmake win32 Precompiled header (#19273) * Precompiled header * Fix * Precompiled header for cocos * Precompiled header jscocos2d * Fix for COCOS2D_DEBUG is always 1 on Android (#19291) Related #19289 * little build fix, tests cpp-tests works on mac * sync v3 build related codes into metal-support (#173) * strict initialization for std::array * remove proj.win32 project configs * modern cmake, cmake_cleanup_remove_unused_variables (#19146) * Switch travis CI to xenial (#19207) * Switch travis CI to xenial * Remove language: android * Set language: cpp * Fix java problem * Update sdkmanager * Fix sdkmanger * next sdkmanager fix * Remove xenial from android * revert to sdk-tools-{system}-3859397 * Remove linux cmake install * Update before-install.sh * Update .travis.yml * Simplify install-deps-linux.sh, tested on Ubuntu 16.04 (#19212) * Simplify install-deps-linux.sh * Cleanup * pick: install ninja * update cocos2d-console submodule * for metal-support alpha release, we only test cpp * add HelloCpp into project(Cocos2d-x) for tmp test * update extenal metal-support-4 * update uniform setting * [Feature] update BindGroup * [Feature] empty-test * [Feature] cpp-test * [Feature] fix GL compiler error * [Feature] fix GL crash * [Feature] empty-test * [Feature] cpp-tests * [feature] improve frameRate * [feature] fix opengl compile error * [feature] fix opengl compile error * [BugFix] fix compute maxLocation error * [Feature] update setting unifrom * [Feature] fix namespace * [Feature] remove unneeded code * [Bugfix] fix project file * [Feature] update review * [texture2d] impl texture format support (#175) * texture update * update * update texture * commit * compile on windows * ddd * rename * rename methods * no crash * save gl * save * save * rename * move out pixel format convert functions * metal crash * update * update android * support gles compressed texture format * support more compress format * add more conversion methods * ss * save * update conversion methods * add PVRTC format support * reformat * add marco linux * fix GL marcro * pvrtc supported only by ios 8.0+ * remove unused cmake * revert change * refactor Texture2D::initWithData * fix conversion log * refactor Texture2D::initWithData * remove some OpenGL constants for PVRTC * add todo * fix typo * AutoTest works on mac/iOS by disable part cases, sync v3 bug fix (#174) * review cpp-tests, and fix part issues on start auto test * sync png format fix: Node:Particle3D abnormal texture effects #19204 * fix cpp-tests SpritePolygon crash, wrong png format (#19170) * fix wrong png convert format from sRGB to Gray * erase plist index if all frames was erased * test_A8.png have I8 format, fix it * [CCSpriteCache] allow re-add plist & add testcase (#19175) * allow re-add plist & add testcase * remove comments/rename method/update testcase * fix isSpriteFramesWithFileLoaded & add testcase * remove used variable * remove unused variable * fix double free issues when js/lua-tests exit on iOS (#19236) * disable part cases, AutoTest works without crash on mac * update cocos2dx files json, to test cocos new next * fix spritecache plist parsing issue (#19269) * [linux] Fix FileUtils::getContents with folder (#19157) * fix FileUtils::getContents on linux/mac * use stat.st_mode * simplify * [CCFileUtils] win32 getFileSize (#19176) * win32 getFileSize * fix stat * [cpp test-Android]20:FileUtils/2 change title (#19197) * sync #19200 * sync #19231 * [android lua] improve performance of lua loader (#19234) * [lua] improve performance of lua loader * remove cache fix * Revert "fix spritecache plist parsing issue (#19269)" This reverts commit f3a85ece4307a7b90816c34489d1ed2c8fd11baf. * remove win32 project files ref in template.json * add metal framework lnk ref into cpp template * test on iOS, and disable part cases * alBufferData instead of alBufferDataStatic for small audio file on Apple (#19227) * changes AudioCache to use alBufferData instead of alBufferDataStatic (also makes test 19 faster to trigger openal bugs faster) The original problem: CrashIfClientProvidedBogusAudioBufferList https://github.com/cocos2d/cocos2d-x/issues/18948 is not happening anymore, but there's still a not very frequent issue that makes OpenAL crash with a call stack like this. AudioCache::readDataTask > alBufferData > CleanUpDeadBufferList It happes more frequently when the device is "cold", which means after half an hour of not using the device (locked). I could not find the actual source code for iOS OpenAL, so I used the macOS versions: https://opensource.apple.com/source/OpenAL/OpenAL-48.7/Source/OpenAL/oalImp.cpp.auto.html They seem to use CAGuard.h to make sure the dead buffer list has no threading issues. I'm worried because the CAGuard code I found has macos and win32 define but no iOS, so I'm not sure. I guess the iOS version is different and has the guard. I could not find a place in the code that's unprotected by the locks except the InitializeBufferMap() which should not be called more than once from cocos, and there's a workaround in AudioEngine-impl for it. I reduced the occurence of the CleanUpDeadBufferList crash by moving the guard in ~AudioCache to cover the alDeleteBuffers call. * remove hack method "setTimeout" on audio * AutoTest works on iOS * support set ios deployment target for root project * enable all texture2d cases, since Jiang have fixed * add CCTextureUtils to xcode project file (#176) * add leak cases for SpriteFrameCache (#177) * re-add SpriteFrameCache cases * update template file json * Update SpriteFrameCacheTest.cpp * fix compiling error
2019-01-18 15:08:25 +08:00
}
2021-12-25 10:04:45 +08:00
void Sprite::setTexture(Texture2D* texture)
{
2022-07-16 10:43:05 +08:00
AXASSERT(!_batchNode || (texture && texture == _batchNode->getTexture()),
2021-12-25 10:04:45 +08:00
"CCSprite: Batched sprites should use the same texture as the batchnode");
// accept texture==nil as argument
2022-07-16 10:43:05 +08:00
AXASSERT(!texture || dynamic_cast<Texture2D*>(texture), "setTexture expects a Texture2D. Invalid argument");
2021-12-25 10:04:45 +08:00
if (texture == nullptr)
{
// Gets the texture by key firstly.
2022-07-15 19:17:01 +08:00
texture = _director->getTextureCache()->getTextureForKey(AX_2x2_WHITE_IMAGE_KEY);
// If texture wasn't in cache, create it from RAW data.
if (texture == nullptr)
{
2021-12-25 10:04:45 +08:00
Image* image = new Image();
2022-07-15 19:17:01 +08:00
bool AX_UNUSED isOK = image->initWithRawData(cc_2x2_white_image, sizeof(cc_2x2_white_image), 2, 2, 8);
2022-07-16 10:43:05 +08:00
AXASSERT(isOK, "The 2x2 empty texture was created unsuccessfully.");
2022-07-15 19:17:01 +08:00
texture = _director->getTextureCache()->addImage(image, AX_2x2_WHITE_IMAGE_KEY);
AX_SAFE_RELEASE(image);
}
}
2019-07-19 13:43:20 +08:00
bool needsUpdatePS =
(!_programState || _programState->getProgram()->getProgramType() < backend::ProgramType::CUSTOM_PROGRAM) &&
(_texture == nullptr || _texture->getSamplerFlags() != texture->getSamplerFlags());
2019-07-19 13:43:20 +08:00
if (_renderMode != RenderMode::QUAD_BATCHNODE)
{
2019-07-19 13:43:20 +08:00
if (_texture != texture)
{
2022-07-15 19:17:01 +08:00
AX_SAFE_RETAIN(texture);
AX_SAFE_RELEASE(_texture);
2019-07-19 13:43:20 +08:00
_texture = texture;
}
updateBlendFunc();
}
2020-09-09 13:03:31 +08:00
if (needsUpdatePS)
setProgramState(backend::ProgramType::POSITION_TEXTURE_COLOR);
else
updateProgramStateTexture(_texture);
}
Texture2D* Sprite::getTexture() const
{
return _texture;
2013-11-14 07:55:36 +08:00
}
void Sprite::setTextureRect(const Rect& rect)
{
setTextureRect(rect, false, rect.size);
}
2021-10-23 23:27:14 +08:00
void Sprite::setTextureRect(const Rect& rect, bool rotated, const Vec2& untrimmedSize)
{
_rectRotated = rotated;
Node::setContentSize(untrimmedSize);
_originalContentSize = untrimmedSize;
setVertexRect(rect);
updateStretchFactor();
updatePoly();
}
void Sprite::updatePoly()
{
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
// There are 3 cases:
//
2017-01-11 09:31:45 +08:00
// A) a non 9-sliced, non stretched
// contentsize doesn't not affect the stretching, since there is no stretching
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
// this was the original behavior, and we keep it for backwards compatibility reasons
2017-01-11 09:31:45 +08:00
// When non-stretching is enabled, we have to change the offset in order to "fill the empty" space at the
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
// left-top of the texture
2017-01-11 09:31:45 +08:00
// B) non 9-sliced, stretched
// the texture is stretched to the content size
// C) 9-sliced, stretched
// the sprite is 9-sliced and stretched.
if (_renderMode == RenderMode::QUAD || _renderMode == RenderMode::QUAD_BATCHNODE)
{
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
Rect copyRect;
if (_stretchEnabled)
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
// case B)
copyRect = Rect(0, 0, _rect.size.width * _stretchFactor.x, _rect.size.height * _stretchFactor.y);
else
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
// case A)
// modify origin to put the sprite in the correct offset
2021-12-25 10:04:45 +08:00
copyRect =
Rect((_contentSize.width - _originalContentSize.width) / 2.0f,
(_contentSize.height - _originalContentSize.height) / 2.0f, _rect.size.width, _rect.size.height);
setTextureCoords(_rect, &_quad);
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
setVertexCoords(copyRect, &_quad);
_polyInfo.setQuad(&_quad);
}
else if (_renderMode == RenderMode::SLICE9)
{
// case C)
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
// How the texture is split
//
// u,v: are the texture coordinates
// w,h: are the width and heights
//
// w0 w1 w2
// v2 +----+------+--+
// | | | |
// | | | |
// | 6 | 7 | 8| h2
// | | | |
// v1 +----+------+--|
// | | | |
// | 3 | 4 | 5| h1
// v0 +----+------+--|
// | | | |
// | 0 | 1 | 2| h0
// | | | |
// +----+------+--+
// u0 u1 u2
//
//
// and when the texture is rotated, it will get transformed.
// not only the rects have a different position, but also u,v
// points to the bottom-left and not top-right of the texture
// so some swaping/origin/reordering needs to be done in order
// to support rotated slice-9 correctly
//
// w0 w1 w2
// v2 +------+----+--------+
// | | | |
// | 0 | 3 | 6 | h2
// v1 +------+----+--------+
// | | | |
// | 1 | 4 | 7 | h1
// | | | |
// v0 +------+----+--------+
// | 2 | 5 | 8 | h0
// +------+----+--------+
// u0 u1 u2
// center rect
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
float cx1 = _centerRectNormalized.origin.x;
float cy1 = _centerRectNormalized.origin.y;
float cx2 = _centerRectNormalized.origin.x + _centerRectNormalized.size.width;
float cy2 = _centerRectNormalized.origin.y + _centerRectNormalized.size.height;
// "O"riginal rect
const float oox = _rect.origin.x;
const float ooy = _rect.origin.y;
2021-12-25 10:04:45 +08:00
float osw = _rect.size.width;
float osh = _rect.size.height;
if (_rectRotated)
{
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
std::swap(cx1, cy1);
std::swap(cx2, cy2);
// when the texture is rotated, then the centerRect starts from the "bottom" (left)
// but when it is not rotated, it starts from the top, so invert it
cy2 = 1 - cy2;
cy1 = 1 - cy1;
std::swap(cy1, cy2);
std::swap(osw, osh);
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
}
//
// textCoords Data: Y must be inverted.
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
//
const float w0 = osw * cx1;
2021-12-25 10:04:45 +08:00
const float w1 = osw * (cx2 - cx1);
const float w2 = osw * (1 - cx2);
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
const float h0 = osh * cy1;
2021-12-25 10:04:45 +08:00
const float h1 = osh * (cy2 - cy1);
const float h2 = osh * (1 - cy2);
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
const float u0 = oox;
const float u1 = u0 + w0;
const float u2 = u1 + w1;
const float v2 = ooy;
const float v1 = v2 + h2;
const float v0 = v1 + h1;
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
const Rect texRects_normal[9] = {
2021-12-25 10:04:45 +08:00
Rect(u0, v0, w0, h0), // bottom-left
Rect(u1, v0, w1, h0), // bottom
Rect(u2, v0, w2, h0), // bottom-right
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
2021-12-25 10:04:45 +08:00
Rect(u0, v1, w0, h1), // left
Rect(u1, v1, w1, h1), // center
Rect(u2, v1, w2, h1), // right
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
2021-12-25 10:04:45 +08:00
Rect(u0, v2, w0, h2), // top-left
Rect(u1, v2, w1, h2), // top
Rect(u2, v2, w2, h2), // top-right
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
};
// swap width and height because setTextureCoords()
// will expects the hight and width to be swapped
const Rect texRects_rotated[9] = {
2021-12-25 10:04:45 +08:00
Rect(u0, v2, h2, w0), // top-left
Rect(u0, v1, h1, w0), // left
Rect(u0, v0, h0, w0), // bottom-left
2021-12-25 10:04:45 +08:00
Rect(u1, v2, h2, w1), // top
Rect(u1, v1, h1, w1), // center
Rect(u1, v0, h0, w1), // bottom
2021-12-25 10:04:45 +08:00
Rect(u2, v2, h2, w2), // top-right
Rect(u2, v1, h1, w2), // right
Rect(u2, v0, h0, w2), // bottom-right
};
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
const Rect* texRects = _rectRotated ? texRects_rotated : texRects_normal;
//
// vertex Data.
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
//
// reset center rect since it is altered when when the texture
// is rotated
cx1 = _centerRectNormalized.origin.x;
cy1 = _centerRectNormalized.origin.y;
cx2 = _centerRectNormalized.origin.x + _centerRectNormalized.size.width;
cy2 = _centerRectNormalized.origin.y + _centerRectNormalized.size.height;
if (_rectRotated)
std::swap(osw, osh);
// sizes
float x0_s = osw * cx1;
2021-12-25 10:04:45 +08:00
float x1_s = osw * (cx2 - cx1) * _stretchFactor.x;
float x2_s = osw * (1 - cx2);
float y0_s = osh * cy1;
2021-12-25 10:04:45 +08:00
float y1_s = osh * (cy2 - cy1) * _stretchFactor.y;
float y2_s = osh * (1 - cy2);
// avoid negative size:
if (_contentSize.width < x0_s + x2_s)
x2_s = x0_s = _contentSize.width / 2;
2021-12-25 10:04:45 +08:00
if (_contentSize.height < y0_s + y2_s)
y2_s = y0_s = _contentSize.height / 2;
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
// is it flipped?
// swap sizes to calculate offset correctly
if (_flippedX)
std::swap(x0_s, x2_s);
if (_flippedY)
std::swap(y0_s, y2_s);
// origins
float x0 = 0;
float x1 = x0 + x0_s;
float x2 = x1 + x1_s;
float y0 = 0;
float y1 = y0 + y0_s;
float y2 = y1 + y1_s;
// swap origin, but restore size to its original value
if (_flippedX)
{
std::swap(x0, x2);
std::swap(x0_s, x2_s);
}
if (_flippedY)
{
std::swap(y0, y2);
std::swap(y0_s, y2_s);
}
const Rect verticesRects[9] = {
2021-12-25 10:04:45 +08:00
Rect(x0, y0, x0_s, y0_s), // bottom-left
Rect(x1, y0, x1_s, y0_s), // bottom
Rect(x2, y0, x2_s, y0_s), // bottom-right
2021-12-25 10:04:45 +08:00
Rect(x0, y1, x0_s, y1_s), // left
Rect(x1, y1, x1_s, y1_s), // center
Rect(x2, y1, x2_s, y1_s), // right
2021-12-25 10:04:45 +08:00
Rect(x0, y2, x0_s, y2_s), // top-left
Rect(x1, y2, x1_s, y2_s), // top
Rect(x2, y2, x2_s, y2_s), // top-right
};
// needed in order to get color from "_quad"
V3F_C4B_T2F_Quad tmpQuad = _quad;
2021-12-25 10:04:45 +08:00
for (int i = 0; i < 9; ++i)
{
setTextureCoords(texRects[i], &tmpQuad);
setVertexCoords(verticesRects[i], &tmpQuad);
populateTriangle(i, tmpQuad);
}
TrianglesCommand::Triangles triangles;
2021-12-25 10:04:45 +08:00
triangles.verts = _trianglesVertex;
triangles.vertCount = 16;
triangles.indices = _trianglesIndex;
triangles.indexCount = 6 * 9; // 9 quads, each needs 6 vertices
// probably we can update the _trianglesCommand directly
// to avoid memcpy'ing stuff
_polyInfo.setTriangles(triangles);
}
}
2022-08-08 18:02:17 +08:00
void Sprite::setCenterRectNormalized(const ax::Rect& rectTopLeft)
{
2021-12-25 10:04:45 +08:00
if (_renderMode != RenderMode::QUAD && _renderMode != RenderMode::SLICE9)
{
2022-07-16 10:43:05 +08:00
AXLOGWARN("Warning: Sprite::setCenterRectNormalized() only works with QUAD and SLICE9 render modes");
return;
}
// FIMXE: Rect is has origin on top-left (like text coordinate).
// but all the logic has been done using bottom-left as origin. So it is easier to invert Y
// here, than in the rest of the places... but it is not as clean.
2021-12-25 10:04:45 +08:00
Rect rect(rectTopLeft.origin.x, 1 - rectTopLeft.origin.y - rectTopLeft.size.height, rectTopLeft.size.width,
rectTopLeft.size.height);
if (!_centerRectNormalized.equals(rect))
{
_centerRectNormalized = rect;
// convert it to 1-slice when the centerRect is not present.
2021-12-25 10:04:45 +08:00
if (rect.equals(Rect(0, 0, 1, 1)))
{
_renderMode = RenderMode::QUAD;
free(_trianglesVertex);
free(_trianglesIndex);
_trianglesVertex = nullptr;
2021-12-25 10:04:45 +08:00
_trianglesIndex = nullptr;
}
else
{
// convert it to 9-slice if it isn't already
if (_renderMode != RenderMode::SLICE9)
{
_renderMode = RenderMode::SLICE9;
// 9 quads + 7 exterior points = 16
2021-12-25 10:04:45 +08:00
_trianglesVertex = (V3F_C4B_T2F*)malloc(sizeof(*_trianglesVertex) * (9 + 3 + 4));
// 9 quads, each needs 6 vertices = 54
2021-12-25 10:04:45 +08:00
_trianglesIndex = (unsigned short*)malloc(sizeof(*_trianglesIndex) * 6 * 9);
// populate indices in CCW direction
2021-12-25 10:04:45 +08:00
for (int i = 0; i < 9; ++i)
{
_trianglesIndex[i * 6 + 0] = (i * 4 / 3) + 4;
_trianglesIndex[i * 6 + 1] = (i * 4 / 3) + 0;
_trianglesIndex[i * 6 + 2] = (i * 4 / 3) + 5;
_trianglesIndex[i * 6 + 3] = (i * 4 / 3) + 1;
_trianglesIndex[i * 6 + 4] = (i * 4 / 3) + 5;
_trianglesIndex[i * 6 + 5] = (i * 4 / 3) + 0;
}
}
}
updateStretchFactor();
updatePoly();
updateColor();
}
}
2022-08-08 18:02:17 +08:00
void Sprite::setCenterRect(const ax::Rect& rectInPoints)
{
if (_renderMode != RenderMode::QUAD && _renderMode != RenderMode::SLICE9)
{
2022-07-16 10:43:05 +08:00
AXLOGWARN("Warning: Sprite::setCenterRect() only works with QUAD and SLICE9 render modes");
return;
}
2021-10-23 23:27:14 +08:00
if (!_originalContentSize.equals(Vec2::ZERO))
{
Rect rect = rectInPoints;
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
const float x = rect.origin.x / _rect.size.width;
const float y = rect.origin.y / _rect.size.height;
const float w = rect.size.width / _rect.size.width;
const float h = rect.size.height / _rect.size.height;
2021-12-25 10:04:45 +08:00
setCenterRectNormalized(Rect(x, y, w, h));
}
}
Rect Sprite::getCenterRectNormalized() const
{
// FIXME: _centerRectNormalized is in bottom-left coords, but should converted to top-left
2021-12-25 10:04:45 +08:00
Rect ret(_centerRectNormalized.origin.x, 1 - _centerRectNormalized.origin.y - _centerRectNormalized.size.height,
_centerRectNormalized.size.width, _centerRectNormalized.size.height);
return ret;
}
Rect Sprite::getCenterRect() const
{
Rect rect = getCenterRectNormalized();
rect.origin.x *= _rect.size.width;
rect.origin.y *= _rect.size.height;
rect.size.width *= _rect.size.width;
rect.size.height *= _rect.size.height;
return rect;
}
// override this method to generate "double scale" sprites
void Sprite::setVertexRect(const Rect& rect)
{
_rect = rect;
}
void Sprite::setTextureCoords(const Rect& rectInPoints)
{
setTextureCoords(rectInPoints, &_quad);
}
void Sprite::setTextureCoords(const Rect& rectInPoints, V3F_C4B_T2F_Quad* outQuad)
{
2021-12-25 10:04:45 +08:00
Texture2D* tex = (_renderMode == RenderMode::QUAD_BATCHNODE) ? _textureAtlas->getTexture() : _texture;
2015-12-16 11:53:59 +08:00
if (tex == nullptr)
return;
2022-07-15 19:17:01 +08:00
const auto rectInPixels = AX_RECT_POINTS_TO_PIXELS(rectInPoints);
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
2021-12-25 10:04:45 +08:00
const float atlasWidth = (float)tex->getPixelsWide();
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
const float atlasHeight = (float)tex->getPixelsHigh();
2021-12-25 10:04:45 +08:00
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
float rw = rectInPixels.size.width;
float rh = rectInPixels.size.height;
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
// if the rect is rotated, it means that the frame is rotated 90 degrees (clockwise) and:
// - rectInpoints: origin will be the bottom-left of the frame (and not the top-right)
// - size: represents the unrotated texture size
//
// so what we have to do is:
// - swap texture width and height
// - take into account the origin
// - flip X instead of Y when flipY is enabled
// - flip Y instead of X when flipX is enabled
if (_rectRotated)
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
std::swap(rw, rh);
2022-07-15 19:17:01 +08:00
#if AX_FIX_ARTIFACTS_BY_STRECHING_TEXEL
2021-12-25 10:04:45 +08:00
float left = (2 * rectInPixels.origin.x + 1) / (2 * atlasWidth);
float right = left + (rw * 2 - 2) / (2 * atlasWidth);
float top = (2 * rectInPixels.origin.y + 1) / (2 * atlasHeight);
float bottom = top + (rh * 2 - 2) / (2 * atlasHeight);
#else
2021-12-25 10:04:45 +08:00
float left = rectInPixels.origin.x / atlasWidth;
float right = (rectInPixels.origin.x + rw) / atlasWidth;
float top = rectInPixels.origin.y / atlasHeight;
float bottom = (rectInPixels.origin.y + rh) / atlasHeight;
2022-07-15 19:17:01 +08:00
#endif // AX_FIX_ARTIFACTS_BY_STRECHING_TEXEL
if ((!_rectRotated && _flippedX) || (_rectRotated && _flippedY))
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
std::swap(left, right);
if ((!_rectRotated && _flippedY) || (_rectRotated && _flippedX))
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
std::swap(top, bottom);
if (_rectRotated)
{
outQuad->bl.texCoords.u = left;
outQuad->bl.texCoords.v = top;
outQuad->br.texCoords.u = left;
outQuad->br.texCoords.v = bottom;
outQuad->tl.texCoords.u = right;
outQuad->tl.texCoords.v = top;
outQuad->tr.texCoords.u = right;
outQuad->tr.texCoords.v = bottom;
}
else
{
outQuad->bl.texCoords.u = left;
outQuad->bl.texCoords.v = bottom;
outQuad->br.texCoords.u = right;
outQuad->br.texCoords.v = bottom;
outQuad->tl.texCoords.u = left;
outQuad->tl.texCoords.v = top;
outQuad->tr.texCoords.u = right;
outQuad->tr.texCoords.v = top;
}
}
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
void Sprite::setVertexCoords(const Rect& rect, V3F_C4B_T2F_Quad* outQuad)
{
float relativeOffsetX = _unflippedOffsetPositionFromCenter.x;
float relativeOffsetY = _unflippedOffsetPositionFromCenter.y;
// issue #732
if (_flippedX)
relativeOffsetX = -relativeOffsetX;
if (_flippedY)
relativeOffsetY = -relativeOffsetY;
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
_offsetPosition.x = relativeOffsetX + (_originalContentSize.width - _rect.size.width) / 2;
_offsetPosition.y = relativeOffsetY + (_originalContentSize.height - _rect.size.height) / 2;
// FIXME: Stretching should be applied to the "offset" as well
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
// but probably it should be calculated in the caller function. It will be tidier
if (_renderMode == RenderMode::QUAD)
{
_offsetPosition.x *= _stretchFactor.x;
_offsetPosition.y *= _stretchFactor.y;
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
}
// rendering using batch node
2017-01-11 21:33:41 +08:00
if (_renderMode == RenderMode::QUAD_BATCHNODE)
{
// update dirty_, don't update recursiveDirty_
setDirty(true);
}
else
{
// self rendering
// Atlas: Vertex
const float x1 = 0.0f + _offsetPosition.x + rect.origin.x;
const float y1 = 0.0f + _offsetPosition.y + rect.origin.y;
const float x2 = x1 + rect.size.width;
const float y2 = y1 + rect.size.height;
// Don't update Z.
outQuad->bl.vertices.set(x1, y1, 0.0f);
outQuad->br.vertices.set(x2, y1, 0.0f);
outQuad->tl.vertices.set(x1, y2, 0.0f);
outQuad->tr.vertices.set(x2, y2, 0.0f);
}
}
void Sprite::populateTriangle(int quadIndex, const V3F_C4B_T2F_Quad& quad)
{
2022-07-16 10:43:05 +08:00
AXASSERT(quadIndex < 9, "Invalid quadIndex");
// convert Quad intro Triangle since it takes less memory
// Triangles are ordered like the following:
// Numbers: Quad Index
// Letters: triangles' vertices
//
// M-----N-----O-----P
// | | | |
// | 6 | 7 | 8 |
// | | | |
// I-----J-----K-----L
// | | | |
// | 3 | 4 | 5 |
// | | | |
// E-----F-----G-----H
// | | | |
// | 0 | 1 | 2 |
// | | | |
// A-----B-----C-----D
//
// So, if QuadIndex == 4, then it should update vertices J,K,F,G
// Optimization: I don't need to copy all the vertices all the time. just the 4 "quads" from the corners.
if (quadIndex == 0 || quadIndex == 2 || quadIndex == 6 || quadIndex == 8)
{
if (_flippedX)
{
if (quadIndex % 3 == 0)
quadIndex += 2;
else
quadIndex -= 2;
}
if (_flippedY)
{
if (quadIndex <= 2)
quadIndex += 6;
else
quadIndex -= 6;
}
const int index_bl = quadIndex * 4 / 3;
const int index_br = index_bl + 1;
const int index_tl = index_bl + 4;
const int index_tr = index_bl + 5;
_trianglesVertex[index_tr] = quad.tr;
_trianglesVertex[index_br] = quad.br;
_trianglesVertex[index_tl] = quad.tl;
_trianglesVertex[index_bl] = quad.bl;
}
}
// MARK: visit, draw, transform
void Sprite::updateTransform()
{
2022-07-16 10:43:05 +08:00
AXASSERT(_renderMode == RenderMode::QUAD_BATCHNODE,
2021-12-25 10:04:45 +08:00
"updateTransform is only valid when Sprite is being rendered using an SpriteBatchNode");
2014-02-10 11:39:56 +08:00
// recalculate matrix only if it is dirty
2021-12-25 10:04:45 +08:00
if (isDirty())
{
// If it is not visible, or one of its ancestors is not visible, then do nothing:
2021-12-25 10:04:45 +08:00
if (!_visible || (_parent && _parent != _batchNode && static_cast<Sprite*>(_parent)->_shouldBeHidden))
{
_quad.br.vertices.setZero();
_quad.tl.vertices.setZero();
_quad.tr.vertices.setZero();
_quad.bl.vertices.setZero();
_shouldBeHidden = true;
}
2013-11-26 08:33:05 +08:00
else
{
_shouldBeHidden = false;
2021-12-25 10:04:45 +08:00
if (!_parent || _parent == _batchNode)
_transformToBatch = getNodeToParentTransform();
2013-11-27 03:48:37 +08:00
else
{
2022-07-16 10:43:05 +08:00
AXASSERT(dynamic_cast<Sprite*>(_parent), "Logic error in Sprite. Parent must be a Sprite");
2021-12-25 10:04:45 +08:00
const Mat4& nodeToParent = getNodeToParentTransform();
Mat4& parentTransform = static_cast<Sprite*>(_parent)->_transformToBatch;
_transformToBatch = parentTransform * nodeToParent;
}
//
// calculate the Quad based on the Affine Matrix
//
2021-12-25 10:04:45 +08:00
Vec2& size = _rect.size;
float x1 = _offsetPosition.x;
float y1 = _offsetPosition.y;
float x2 = x1 + size.width;
float y2 = y1 + size.height;
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
float x = _transformToBatch.m[12];
float y = _transformToBatch.m[13];
2021-12-25 10:04:45 +08:00
float cr = _transformToBatch.m[0];
float sr = _transformToBatch.m[1];
float cr2 = _transformToBatch.m[5];
float sr2 = -_transformToBatch.m[4];
2021-12-25 10:04:45 +08:00
float ax = x1 * cr - y1 * sr2 + x;
float ay = x1 * sr + y1 * cr2 + y;
float bx = x2 * cr - y1 * sr2 + x;
float by = x2 * sr + y1 * cr2 + y;
float cx = x2 * cr - y2 * sr2 + x;
float cy = x2 * sr + y2 * cr2 + y;
float dx = x1 * cr - y2 * sr2 + x;
float dy = x1 * sr + y2 * cr2 + y;
2015-07-08 15:30:34 +08:00
_quad.bl.vertices.set(SPRITE_RENDER_IN_SUBPIXEL(ax), SPRITE_RENDER_IN_SUBPIXEL(ay), _positionZ);
_quad.br.vertices.set(SPRITE_RENDER_IN_SUBPIXEL(bx), SPRITE_RENDER_IN_SUBPIXEL(by), _positionZ);
_quad.tl.vertices.set(SPRITE_RENDER_IN_SUBPIXEL(dx), SPRITE_RENDER_IN_SUBPIXEL(dy), _positionZ);
_quad.tr.vertices.set(SPRITE_RENDER_IN_SUBPIXEL(cx), SPRITE_RENDER_IN_SUBPIXEL(cy), _positionZ);
2015-12-14 15:35:26 +08:00
setTextureCoords(_rect);
}
// MARMALADE CHANGE: ADDED CHECK FOR nullptr, TO PERMIT SPRITES WITH NO BATCH NODE / TEXTURE ATLAS
if (_textureAtlas)
_textureAtlas->updateQuad(&_quad, _atlasIndex);
2013-11-26 08:33:05 +08:00
_recursiveDirty = false;
setDirty(false);
}
Node::updateTransform();
}
// draw
2021-12-25 10:04:45 +08:00
void Sprite::draw(Renderer* renderer, const Mat4& transform, uint32_t flags)
{
metal support for cocos2d-x (#19305) * remove deprecated files * remove some deprecated codes * remove more deprecated codes * remove ui deprecated codes * remove more deprecated codes * remove deprecated codes in ccmenuitem * remove more deprecated codes in ui * remove more deprecated codes in ui * remove more deprecated codes in ui * remove more deprecated codes * remove more deprecated codes * remove more deprecated codes * remove vr related codes and ignore some modules * remove allocator * remove some config * 【Feature】add back-end project file * [Feature] add back-end file * add pipeline descriptor and shader cache * [Feature] support sprite for backend * [Feature] remove unneeded code * [Feature] according to es2.0 spec, you must use clamp-to-edge as texture wrap mode, and no mipmapping for non-power-of-two texture * [Feature] set texture wrap mode to clamp-to-edge, and no mipmapping for non-power-of-two texture * [Feature] remove macro define to .cpp file * [Feature] add log info * [Feature] add PipelineDescriptor for TriangleCommand * [Feature] add PipelineDescriptor object as member of TriangleCommand * [Feature] add getPipelineDescriptor method * add renderbackend * complete pipeline descriptor * [Feature] add viewport in RenderCommand * set viewport when rendrering * [Feature] occur error when using RendererBackend, to be fixed. * a workaround to fix black screen on macOS 10.14 (#19090) * add rendererbackend init function * fix typo * [Feature] modify testFile * [BugFix] modify shader path * [Feature] set default viewport * fix projection * [Feature] modify log info * [BugFix] change viewport data type to int * [BugFix] add BindGroup to PipelienDescriptor * [BugFix] change a_position to vec3 in sprite.vert * [BugFix] set vertexLayout according to V3F_C4B_T2F structure * [Feature] revert a_position to vec4 * [Feature] renderer should not use gl codes directly * [Feature] it's better not use default value parameter * fix depth test setting * rendererbackend -> renderer * clear color and depth at begin * add metal backend * metal support normalized attribute * simplify codes * update external * add render pass desctriptor in pipeline descriptor * fix warnings * fix crash and memeory leak * refactor Texture2D * put pipeline descriptor into render command * simplify codes * [Feature] update Sprite * fix crash when closing app * [Feature] update SpriteBatchNode and TextureAtlas * support render texture(not finish) * [Feature] remove unused code * make tests work on mac * fix download-deps path error * make tests work on iOS * [Feature] support ttf under normal label effect * refactor triangle command processing * let renderer handle more common commands * refactor backend * make render texture work * [Feature] refactor backend for GL * [Feature]Renaming to make it easy to understand * [Feature] change warp mode to CLAMP_TO_EDGE * fix ghost * simplify visit render queue logic * support progress timer without rial mode * support partcile system * Feature/update label (#149) * [BugFix] fix compile error * [Feature] support outline effect in ios * [Feature] add shader file * [BugFix] fix begin and end RenderPass * [Feature] update CustomCommand * [Feature] revert project.pbxproj * [Feature] simplify codes * [BugFix] pack AI88 to RGBA8888 only when outline enable * [Feature] support shadow effect in Label * [Feature] support BMFont * [Feature] support glow effect * [Feature] simplify shader files * LabelAtlas work * handle blend function correctly * support tile map * don't share buffer in metal * alloc buffer size as needed * support more tilemap * Merge branch 'minggo/metal-support' into feature/updateLabel * minggo/metal-support: support tile map handle blend function correctly LabelAtlas work Feature/update label (#149) support partcile system # Conflicts: # cocos/2d/CCLabel.cpp # cocos/2d/CCSprite.cpp # cocos/2d/CCSpriteBatchNode.cpp # cocos/renderer/CCQuadCommand.cpp # cocos/renderer/CCQuadCommand.h * render texture work without saving file * use global viewport * grid3d works * remove grabber * tiled3d works * [BugFix] fix label bug * [Feature] add updateSubData for buffer * [Feature] remove setVertexCount * support depth test * add callback command * [Feature] add UITest * [Feature] update UITest * [Feature] remove unneeded codes * fix custom command issue * fix layer color blend issue * [BugFix] fix iOS compile error * [Feature] remove unneeded codes * [Feature] fix updateVertexBuffer * layerradial works * add draw test back * fix batch issue * fix compiling error * [BugFix] support ETC1 * [BugFix] get the correct pipelineDescriptor * [BugFix] skip draw when backendTexture nullptr * clipping node support * [Feature] add shader files * fix stencil issue in metal * [Feature] update UILayoutTest * [BugFix] skip drawing when vertexCount is zero * refactor renderer * add set global z order for stencil manager commands * fix warnings caused by type * remove viewport in render command * [Feature] fix warnings caused by type * [BugFix] clear vertexCount and indexCount for CustomComand when needed * [Feature] update clear for CustomCommand * ios use metal * fix viewport issue * fix LayerColorGradient crash * [cmake] transport to android and windows (#160) * save point 1 * compile on windows * run on android * revert useless change * android set CC_ENABLE_CACHE_TEXTURE_DATA to 1 * add initGlew * fix android crash * add TODO new-renderer * review update * revert onGLFWWindowPosCallback * fix android compiling error * Impl progress radial (#162) * progresstimer add radial impl * default drawType to element * dec invoke times of createVertexBuffer (#163) * support depth/stencil format for gl backend * simplify progress timer codes * support motionstreak, effect is wrong * fix motionstreak issue * [Feature] update Scissor Test (#161) * [Feature] update Scissor Test * [Feature] update ScissorTest * [Feature] rename function * [Feature] get constant reference if needed * [Feature] show render status (#164) * improve performance * fix depth state * fill error that triangle vertex/index number bigger than buffer * fix compiline error in release mode * fix buffer conflict between CPU and GPU on iOS/macOS * Renderer refactor (#165) * use one vertes/index buffer with opengl * fix error on windows * custom command support index format config * CCLayer: compact vertex data structure * update comment * fix doc * support fast tilemap * pass index format instead * fix some wrong effect * fix render texture error * fix texture per-element size * fix texture format error * BlendFunc type refactor, GLenum -> backend::BlendFactor (#167) * BlendFunc use backend::BlendFactor as inner field * update comments * use int to replace GLenum * update xcode project fiel * rename to GLBlendConst * add ccConstants.h * update xcode project file * update copyright * remove primitive command * remove CCPrimitive.cpp/.h * remove deprecated files * remove unneeded files * remove multiple view support * remove multiple view support * remove the usage of frame buffer in camera * director don't use frame buffer * remove FrameBuffer * remove BatchCommand * add some api reference * add physics2d back * fix crash when close app on mac * improve render texture * fix rendertexture issue * fix rendertexture issue * simplify codes * CMake support for mac & ios (#169) * update cmake * fix compile error * update 3rd libs version * remove CCThread.h/.cpp * remove ccthread * use audio engine to implement simple audio engine * remove unneeded codes * remove deprecated codes * remove winrt macro * remove CC_USE_WIC * set partcile blend function in more elegant way * remove unneeded codes * remove unneeded codes * cmake works on windows * update project setting * improve performance * GLFloat -> float * sync v3 cmake improvements into metal-support (#172) * pick: modern cmake, compile definitions improvement (#19139) * modern cmake, use target_compile_definitions partly * simplify macro define, remove USE_* * modern cmake, macro define * add physics 2d macro define into ccConfig.h * remove USE_CHIPMUNK macro in build.gradle * remove CocosSelectModule.cmake * shrink useless define * simplify compile options config, re-add if necessary * update external for tmp CI test * un-quote target_compile_options value * add "-g" parameter only when debug mode * keep single build type when generator Xcode & VS projecy * update external for tmp CI tes * add static_cast<char>(-1), fix -Wc++11-narrowing * simplify win32 compile define * not modify code, only improve compile options # Conflicts: # .gitignore # cmake/Modules/CocosConfigDepend.cmake # cocos/CMakeLists.txt # external/config.json # tests/cpp-tests/CMakeLists.txt * modern cmake, improve cmake_compiler_flags (#19145) * cmake_compiler_flags * Fix typo * Fix typo2 * Remove chanages from Android.mk * correct lua template cmake build (#19149) * don't add -Wno-deprecated into jsb target * correct lua template cmake build * fix win32 lua template compile error * prevent cmake in-source-build friendly (#19151) * pick: Copy resources to "Resources/" on win32 like in linux configuration * add "/Z7" for cpp-tests on windows * [cmake] fix iOS xcode property setting failed (#19208) * fix iOS xcode property setting failed * use search_depend_libs_recursive at dlls collect * fix typo * [cmake] add find_host_library into iOS toolchain file (#19230) * pick: [lua android] use luajit & template cmake update (#19239) * increase cmake stability , remove tests/CMakeLists.txt (#19261) * cmake win32 Precompiled header (#19273) * Precompiled header * Fix * Precompiled header for cocos * Precompiled header jscocos2d * Fix for COCOS2D_DEBUG is always 1 on Android (#19291) Related #19289 * little build fix, tests cpp-tests works on mac * sync v3 build related codes into metal-support (#173) * strict initialization for std::array * remove proj.win32 project configs * modern cmake, cmake_cleanup_remove_unused_variables (#19146) * Switch travis CI to xenial (#19207) * Switch travis CI to xenial * Remove language: android * Set language: cpp * Fix java problem * Update sdkmanager * Fix sdkmanger * next sdkmanager fix * Remove xenial from android * revert to sdk-tools-{system}-3859397 * Remove linux cmake install * Update before-install.sh * Update .travis.yml * Simplify install-deps-linux.sh, tested on Ubuntu 16.04 (#19212) * Simplify install-deps-linux.sh * Cleanup * pick: install ninja * update cocos2d-console submodule * for metal-support alpha release, we only test cpp * add HelloCpp into project(Cocos2d-x) for tmp test * update extenal metal-support-4 * update uniform setting * [Feature] update BindGroup * [Feature] empty-test * [Feature] cpp-test * [Feature] fix GL compiler error * [Feature] fix GL crash * [Feature] empty-test * [Feature] cpp-tests * [feature] improve frameRate * [feature] fix opengl compile error * [feature] fix opengl compile error * [BugFix] fix compute maxLocation error * [Feature] update setting unifrom * [Feature] fix namespace * [Feature] remove unneeded code * [Bugfix] fix project file * [Feature] update review * [texture2d] impl texture format support (#175) * texture update * update * update texture * commit * compile on windows * ddd * rename * rename methods * no crash * save gl * save * save * rename * move out pixel format convert functions * metal crash * update * update android * support gles compressed texture format * support more compress format * add more conversion methods * ss * save * update conversion methods * add PVRTC format support * reformat * add marco linux * fix GL marcro * pvrtc supported only by ios 8.0+ * remove unused cmake * revert change * refactor Texture2D::initWithData * fix conversion log * refactor Texture2D::initWithData * remove some OpenGL constants for PVRTC * add todo * fix typo * AutoTest works on mac/iOS by disable part cases, sync v3 bug fix (#174) * review cpp-tests, and fix part issues on start auto test * sync png format fix: Node:Particle3D abnormal texture effects #19204 * fix cpp-tests SpritePolygon crash, wrong png format (#19170) * fix wrong png convert format from sRGB to Gray * erase plist index if all frames was erased * test_A8.png have I8 format, fix it * [CCSpriteCache] allow re-add plist & add testcase (#19175) * allow re-add plist & add testcase * remove comments/rename method/update testcase * fix isSpriteFramesWithFileLoaded & add testcase * remove used variable * remove unused variable * fix double free issues when js/lua-tests exit on iOS (#19236) * disable part cases, AutoTest works without crash on mac * update cocos2dx files json, to test cocos new next * fix spritecache plist parsing issue (#19269) * [linux] Fix FileUtils::getContents with folder (#19157) * fix FileUtils::getContents on linux/mac * use stat.st_mode * simplify * [CCFileUtils] win32 getFileSize (#19176) * win32 getFileSize * fix stat * [cpp test-Android]20:FileUtils/2 change title (#19197) * sync #19200 * sync #19231 * [android lua] improve performance of lua loader (#19234) * [lua] improve performance of lua loader * remove cache fix * Revert "fix spritecache plist parsing issue (#19269)" This reverts commit f3a85ece4307a7b90816c34489d1ed2c8fd11baf. * remove win32 project files ref in template.json * add metal framework lnk ref into cpp template * test on iOS, and disable part cases * alBufferData instead of alBufferDataStatic for small audio file on Apple (#19227) * changes AudioCache to use alBufferData instead of alBufferDataStatic (also makes test 19 faster to trigger openal bugs faster) The original problem: CrashIfClientProvidedBogusAudioBufferList https://github.com/cocos2d/cocos2d-x/issues/18948 is not happening anymore, but there's still a not very frequent issue that makes OpenAL crash with a call stack like this. AudioCache::readDataTask > alBufferData > CleanUpDeadBufferList It happes more frequently when the device is "cold", which means after half an hour of not using the device (locked). I could not find the actual source code for iOS OpenAL, so I used the macOS versions: https://opensource.apple.com/source/OpenAL/OpenAL-48.7/Source/OpenAL/oalImp.cpp.auto.html They seem to use CAGuard.h to make sure the dead buffer list has no threading issues. I'm worried because the CAGuard code I found has macos and win32 define but no iOS, so I'm not sure. I guess the iOS version is different and has the guard. I could not find a place in the code that's unprotected by the locks except the InitializeBufferMap() which should not be called more than once from cocos, and there's a workaround in AudioEngine-impl for it. I reduced the occurence of the CleanUpDeadBufferList crash by moving the guard in ~AudioCache to cover the alDeleteBuffers call. * remove hack method "setTimeout" on audio * AutoTest works on iOS * support set ios deployment target for root project * enable all texture2d cases, since Jiang have fixed * add CCTextureUtils to xcode project file (#176) * add leak cases for SpriteFrameCache (#177) * re-add SpriteFrameCache cases * update template file json * Update SpriteFrameCacheTest.cpp * fix compiling error
2019-01-18 15:08:25 +08:00
if (_texture == nullptr || _texture->getBackendTexture() == nullptr)
2015-12-16 11:53:59 +08:00
return;
2021-12-25 10:04:45 +08:00
// TODO: arnold: current camera can be a non-default one.
setMVPMatrixUniform();
2022-07-15 19:17:01 +08:00
#if AX_USE_CULLING
// Don't calculate the culling if the transform was not updated
2015-07-30 11:53:23 +08:00
auto visitingCamera = Camera::getVisitingCamera();
2021-12-25 10:04:45 +08:00
auto defaultCamera = Camera::getDefaultCamera();
if (visitingCamera == nullptr)
_insideBounds = true;
else if (visitingCamera == defaultCamera)
2021-12-25 10:04:45 +08:00
_insideBounds = ((flags & FLAGS_TRANSFORM_DIRTY) || visitingCamera->isViewProjectionUpdated())
? renderer->checkVisibility(transform, _contentSize)
: _insideBounds;
2015-07-30 11:53:23 +08:00
else
// XXX: this always return true since
2015-07-30 11:53:23 +08:00
_insideBounds = renderer->checkVisibility(transform, _contentSize);
2021-12-25 10:04:45 +08:00
if (_insideBounds)
2015-01-14 10:56:51 +08:00
#endif
{
2021-12-25 10:04:45 +08:00
_trianglesCommand.init(_globalZOrder, _texture, _blendFunc, _polyInfo.triangles, transform, flags);
2015-05-22 15:54:56 +08:00
renderer->addCommand(&_trianglesCommand);
2021-12-25 10:04:45 +08:00
2022-07-15 19:17:01 +08:00
#if AX_SPRITE_DEBUG_DRAW
2021-12-25 10:04:45 +08:00
_debugDrawNode->clear();
auto count = _polyInfo.triangles.indexCount / 3;
auto indices = _polyInfo.triangles.indices;
auto verts = _polyInfo.triangles.verts;
for (unsigned int i = 0; i < count; i++)
{
// draw 3 lines
Vec3 from = verts[indices[i * 3]].vertices;
Vec3 to = verts[indices[i * 3 + 1]].vertices;
_debugDrawNode->drawLine(Vec2(from.x, from.y), Vec2(to.x, to.y), Color4F::WHITE);
from = verts[indices[i * 3 + 1]].vertices;
to = verts[indices[i * 3 + 2]].vertices;
_debugDrawNode->drawLine(Vec2(from.x, from.y), Vec2(to.x, to.y), Color4F::WHITE);
from = verts[indices[i * 3 + 2]].vertices;
to = verts[indices[i * 3]].vertices;
_debugDrawNode->drawLine(Vec2(from.x, from.y), Vec2(to.x, to.y), Color4F::WHITE);
}
2022-07-15 19:17:01 +08:00
#endif // AX_SPRITE_DEBUG_DRAW
}
2013-11-27 09:13:04 +08:00
}
// MARK: visit, draw, transform
2021-12-25 10:04:45 +08:00
void Sprite::addChild(Node* child, int zOrder, int tag)
{
2022-07-16 10:43:05 +08:00
AXASSERT(child != nullptr, "Argument must be non-nullptr");
2015-12-16 11:53:59 +08:00
if (child == nullptr)
return;
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
2017-01-11 21:33:41 +08:00
if (_renderMode == RenderMode::QUAD_BATCHNODE)
{
Sprite* childSprite = dynamic_cast<Sprite*>(child);
2022-07-16 10:43:05 +08:00
AXASSERT(childSprite, "CCSprite only supports Sprites as children when using SpriteBatchNode");
AXASSERT(childSprite->getTexture() == _textureAtlas->getTexture(),
2021-12-25 10:04:45 +08:00
"childSprite's texture name should be equal to _textureAtlas's texture name!");
// put it in descendants array of batch node
_batchNode->appendChild(childSprite);
if (!_reorderChildDirty)
{
setReorderChildDirtyRecursively();
}
}
2021-12-25 10:04:45 +08:00
// CCNode already sets isReorderChildDirty_ so this needs to be after batchNode check
Node::addChild(child, zOrder, tag);
}
2021-12-26 23:26:34 +08:00
void Sprite::addChild(Node* child, int zOrder, std::string_view name)
2014-06-25 11:27:48 +08:00
{
2022-07-16 10:43:05 +08:00
AXASSERT(child != nullptr, "Argument must be non-nullptr");
2015-12-16 11:53:59 +08:00
if (child == nullptr)
return;
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
2017-01-11 21:33:41 +08:00
if (_renderMode == RenderMode::QUAD_BATCHNODE)
2014-06-25 11:27:48 +08:00
{
Sprite* childSprite = dynamic_cast<Sprite*>(child);
2022-07-16 10:43:05 +08:00
AXASSERT(childSprite, "CCSprite only supports Sprites as children when using SpriteBatchNode");
AXASSERT(childSprite->getTexture() == _textureAtlas->getTexture(),
"childSprite's texture name should be equal to _textureAtlas's texture name.");
2021-12-25 10:04:45 +08:00
// put it in descendants array of batch node
2014-06-25 11:27:48 +08:00
_batchNode->appendChild(childSprite);
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
2014-06-25 11:27:48 +08:00
if (!_reorderChildDirty)
{
setReorderChildDirtyRecursively();
}
}
2021-12-25 10:04:45 +08:00
// CCNode already sets isReorderChildDirty_ so this needs to be after batchNode check
2014-06-25 11:27:48 +08:00
Node::addChild(child, zOrder, name);
}
2021-12-25 10:04:45 +08:00
void Sprite::reorderChild(Node* child, int zOrder)
{
2022-07-16 10:43:05 +08:00
AXASSERT(child != nullptr, "child must be non null");
AXASSERT(_children.contains(child), "child does not belong to this");
2021-12-25 10:04:45 +08:00
if ((_renderMode == RenderMode::QUAD_BATCHNODE) && !_reorderChildDirty)
{
setReorderChildDirtyRecursively();
_batchNode->reorderBatch(true);
}
Node::reorderChild(child, zOrder);
}
2021-12-25 10:04:45 +08:00
void Sprite::removeChild(Node* child, bool cleanup)
{
2017-01-11 21:33:41 +08:00
if (_renderMode == RenderMode::QUAD_BATCHNODE)
_batchNode->removeSpriteFromAtlas((Sprite*)(child));
Node::removeChild(child, cleanup);
}
void Sprite::removeAllChildrenWithCleanup(bool cleanup)
{
2017-01-11 21:33:41 +08:00
if (_renderMode == RenderMode::QUAD_BATCHNODE)
{
2021-12-25 10:04:45 +08:00
for (const auto& child : _children)
{
Sprite* sprite = dynamic_cast<Sprite*>(child);
if (sprite)
_batchNode->removeSpriteFromAtlas(sprite);
}
}
Node::removeAllChildrenWithCleanup(cleanup);
}
void Sprite::sortAllChildren()
{
if (_reorderChildDirty)
{
sortNodes(_children);
2017-01-11 21:33:41 +08:00
if (_renderMode == RenderMode::QUAD_BATCHNODE)
{
2021-12-25 10:04:45 +08:00
for (const auto& child : _children)
child->sortAllChildren();
}
_reorderChildDirty = false;
}
}
//
// Node property overloads
// used only when parent is SpriteBatchNode
//
void Sprite::setReorderChildDirtyRecursively()
{
2021-12-25 10:04:45 +08:00
// only set parents flag the first time
if (!_reorderChildDirty)
{
_reorderChildDirty = true;
2021-12-25 10:04:45 +08:00
Node* node = static_cast<Node*>(_parent);
while (node && node != _batchNode)
{
static_cast<Sprite*>(node)->setReorderChildDirtyRecursively();
2021-12-25 10:04:45 +08:00
node = node->getParent();
}
}
}
void Sprite::setDirtyRecursively(bool bValue)
{
_recursiveDirty = bValue;
setDirty(bValue);
2021-12-25 10:04:45 +08:00
for (const auto& child : _children)
{
Sprite* sp = dynamic_cast<Sprite*>(child);
if (sp)
sp->setDirtyRecursively(true);
}
}
// FIXME: HACK: optimization
2021-12-25 10:04:45 +08:00
#define SET_DIRTY_RECURSIVELY() \
{ \
if (!_recursiveDirty) \
{ \
_recursiveDirty = true; \
setDirty(true); \
if (!_children.empty()) \
setDirtyRecursively(true); \
} \
}
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
void Sprite::setPosition(const Vec2& pos)
{
Node::setPosition(pos);
SET_DIRTY_RECURSIVELY();
}
void Sprite::setPosition(float x, float y)
{
Node::setPosition(x, y);
SET_DIRTY_RECURSIVELY();
}
void Sprite::setRotation(float rotation)
{
Node::setRotation(rotation);
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
SET_DIRTY_RECURSIVELY();
}
void Sprite::setRotationSkewX(float fRotationX)
2012-11-14 18:05:15 +08:00
{
Node::setRotationSkewX(fRotationX);
2012-11-14 18:05:15 +08:00
SET_DIRTY_RECURSIVELY();
}
void Sprite::setRotationSkewY(float fRotationY)
2012-11-14 18:05:15 +08:00
{
Node::setRotationSkewY(fRotationY);
2012-11-14 18:05:15 +08:00
SET_DIRTY_RECURSIVELY();
}
void Sprite::setSkewX(float sx)
{
Node::setSkewX(sx);
SET_DIRTY_RECURSIVELY();
}
void Sprite::setSkewY(float sy)
{
Node::setSkewY(sy);
SET_DIRTY_RECURSIVELY();
}
void Sprite::setScaleX(float scaleX)
{
Node::setScaleX(scaleX);
SET_DIRTY_RECURSIVELY();
}
void Sprite::setScaleY(float scaleY)
{
2022-07-15 19:17:01 +08:00
#ifdef AX_USE_METAL
2021-12-25 10:04:45 +08:00
if (_texture->isRenderTarget())
scaleY = std::abs(scaleY);
#endif
Node::setScaleY(scaleY);
SET_DIRTY_RECURSIVELY();
}
void Sprite::setScale(float fScale)
{
Node::setScale(fScale);
SET_DIRTY_RECURSIVELY();
}
2013-11-06 21:42:31 +08:00
void Sprite::setScale(float scaleX, float scaleY)
{
Node::setScale(scaleX, scaleY);
SET_DIRTY_RECURSIVELY();
}
void Sprite::setPositionZ(float fVertexZ)
{
Node::setPositionZ(fVertexZ);
SET_DIRTY_RECURSIVELY();
}
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
void Sprite::setAnchorPoint(const Vec2& anchor)
{
Node::setAnchorPoint(anchor);
SET_DIRTY_RECURSIVELY();
}
2016-04-22 20:36:02 +08:00
void Sprite::setIgnoreAnchorPointForPosition(bool value)
{
2022-07-16 10:43:05 +08:00
AXASSERT(_renderMode != RenderMode::QUAD_BATCHNODE, "setIgnoreAnchorPointForPosition is invalid in Sprite");
2016-04-22 20:36:02 +08:00
Node::setIgnoreAnchorPointForPosition(value);
}
void Sprite::setVisible(bool bVisible)
{
Node::setVisible(bVisible);
SET_DIRTY_RECURSIVELY();
}
2021-10-23 23:27:14 +08:00
void Sprite::setContentSize(const Vec2& size)
{
2017-01-11 21:33:41 +08:00
if (_renderMode == RenderMode::QUAD_BATCHNODE || _renderMode == RenderMode::POLYGON)
2022-07-16 10:43:05 +08:00
AXLOGWARN(
2021-12-25 10:04:45 +08:00
"Sprite::setContentSize() doesn't stretch the sprite when using QUAD_BATCHNODE or POLYGON render modes");
Node::setContentSize(size);
updateStretchFactor();
updatePoly();
}
void Sprite::setStretchEnabled(bool enabled)
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
{
if (_stretchEnabled != enabled)
{
_stretchEnabled = enabled;
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
// disabled centerrect / number of slices if disabled
if (!enabled)
2021-12-25 10:04:45 +08:00
setCenterRectNormalized(Rect(0, 0, 1, 1));
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
updateStretchFactor();
updatePoly();
}
}
bool Sprite::isStretchEnabled() const
{
return _stretchEnabled;
}
void Sprite::updateStretchFactor()
{
2021-10-23 23:27:14 +08:00
const Vec2 size = getContentSize();
if (_renderMode == RenderMode::QUAD)
{
2017-01-11 09:31:45 +08:00
// If stretch is disabled, calculate the stretch anyway
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
// since it is needed to calculate the offset
const float x_factor = size.width / _originalContentSize.width;
const float y_factor = size.height / _originalContentSize.height;
2021-12-25 10:04:45 +08:00
_stretchFactor = Vec2(std::max(0.0f, x_factor), std::max(0.0f, y_factor));
}
else if (_renderMode == RenderMode::SLICE9)
{
const float x1 = _rect.size.width * _centerRectNormalized.origin.x;
const float x2 = _rect.size.width * _centerRectNormalized.size.width;
const float x3 = _rect.size.width * (1 - _centerRectNormalized.origin.x - _centerRectNormalized.size.width);
const float y1 = _rect.size.height * _centerRectNormalized.origin.y;
const float y2 = _rect.size.height * _centerRectNormalized.size.height;
const float y3 = _rect.size.height * (1 - _centerRectNormalized.origin.y - _centerRectNormalized.size.height);
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
// adjustedSize = the new _rect size
2021-12-25 10:04:45 +08:00
const float adjustedWidth = size.width - (_originalContentSize.width - _rect.size.width);
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
const float adjustedHeight = size.height - (_originalContentSize.height - _rect.size.height);
const float x_factor = (adjustedWidth - x1 - x3) / x2;
const float y_factor = (adjustedHeight - y1 - y3) / y2;
2021-12-25 10:04:45 +08:00
_stretchFactor = Vec2(std::max(0.0f, x_factor), std::max(0.0f, y_factor));
}
// else:
// Do nothing if renderMode is Polygon
}
void Sprite::setFlippedX(bool flippedX)
{
if (_flippedX != flippedX)
{
_flippedX = flippedX;
flipX();
}
}
bool Sprite::isFlippedX() const
{
return _flippedX;
}
void Sprite::setFlippedY(bool flippedY)
{
2022-07-15 19:17:01 +08:00
#ifdef AX_USE_METAL
2021-12-25 10:04:45 +08:00
if (_texture->isRenderTarget())
flippedY = !flippedY;
#endif
if (_flippedY != flippedY)
{
_flippedY = flippedY;
flipY();
}
}
bool Sprite::isFlippedY() const
{
return _flippedY;
}
void Sprite::flipX()
{
if (_renderMode == RenderMode::QUAD_BATCHNODE)
setDirty(true);
else if (_renderMode == RenderMode::POLYGON)
{
2021-12-25 10:04:45 +08:00
for (unsigned int i = 0; i < _polyInfo.triangles.vertCount; i++)
{
auto& v = _polyInfo.triangles.verts[i].vertices;
2021-12-25 10:04:45 +08:00
v.x = _contentSize.width - v.x;
}
}
else
// RenderMode:: Quad or Slice9
updatePoly();
}
void Sprite::flipY()
{
if (_renderMode == RenderMode::QUAD_BATCHNODE)
setDirty(true);
else if (_renderMode == RenderMode::POLYGON)
{
2021-12-25 10:04:45 +08:00
for (unsigned int i = 0; i < _polyInfo.triangles.vertCount; i++)
{
auto& v = _polyInfo.triangles.verts[i].vertices;
2021-12-25 10:04:45 +08:00
v.y = _contentSize.height - v.y;
}
}
else
// RenderMode:: Quad or Slice9
updatePoly();
}
//
// MARK: RGBA protocol
//
void Sprite::updateColor()
{
2021-12-25 10:04:45 +08:00
Color4B color4(_displayedColor.r, _displayedColor.g, _displayedColor.b, _displayedOpacity);
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
2013-02-27 15:30:49 +08:00
// special opacity for premultiplied textures
if (_opacityModifyRGB)
2013-02-27 15:30:49 +08:00
{
color4.r *= _displayedOpacity / 255.0f;
color4.g *= _displayedOpacity / 255.0f;
color4.b *= _displayedOpacity / 255.0f;
2013-02-27 15:30:49 +08:00
}
for (unsigned int i = 0; i < _polyInfo.triangles.vertCount; i++)
_polyInfo.triangles.verts[i].colors = color4;
// related to issue #17116
// when switching from Quad to Slice9, the color will be obtained from _quad
// so it is important to update _quad colors as well.
_quad.bl.colors = _quad.tl.colors = _quad.br.colors = _quad.tr.colors = color4;
// renders using batch node
2017-01-11 21:33:41 +08:00
if (_renderMode == RenderMode::QUAD_BATCHNODE)
{
if (_atlasIndex != INDEX_NOT_INITIALIZED)
_textureAtlas->updateQuad(&_quad, _atlasIndex);
else
// no need to set it recursively
// update dirty_, don't update recursiveDirty_
setDirty(true);
}
// self render
// do nothing
}
void Sprite::setOpacityModifyRGB(bool modify)
{
if (_opacityModifyRGB != modify)
{
_opacityModifyRGB = modify;
2013-02-27 15:30:49 +08:00
updateColor();
}
2013-02-27 15:30:49 +08:00
}
bool Sprite::isOpacityModifyRGB() const
2013-02-27 15:30:49 +08:00
{
return _opacityModifyRGB;
}
// MARK: Frames
2021-12-26 23:26:34 +08:00
void Sprite::setSpriteFrame(std::string_view spriteFrameName)
2013-11-14 07:55:36 +08:00
{
2022-07-16 10:43:05 +08:00
AXASSERT(!spriteFrameName.empty(), "spriteFrameName must not be empty");
2015-12-16 11:53:59 +08:00
if (spriteFrameName.empty())
return;
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
2021-12-25 10:04:45 +08:00
SpriteFrameCache* cache = SpriteFrameCache::getInstance();
SpriteFrame* spriteFrame = cache->getSpriteFrameByName(spriteFrameName);
2013-11-14 07:55:36 +08:00
2022-07-16 10:43:05 +08:00
AXASSERT(spriteFrame, std::string("Invalid spriteFrameName :").append(spriteFrameName).c_str());
2013-11-14 07:55:36 +08:00
setSpriteFrame(spriteFrame);
}
2021-12-25 10:04:45 +08:00
void Sprite::setSpriteFrame(SpriteFrame* spriteFrame)
{
// retain the sprite frame
// do not removed by SpriteFrameCache::removeUnusedSpriteFrames
if (_spriteFrame != spriteFrame)
{
2022-07-15 19:17:01 +08:00
AX_SAFE_RELEASE(_spriteFrame);
_spriteFrame = spriteFrame;
spriteFrame->retain();
}
_unflippedOffsetPositionFromCenter = spriteFrame->getOffset();
2021-12-25 10:04:45 +08:00
Texture2D* texture = spriteFrame->getTexture();
// update texture before updating texture rect
if (texture != _texture)
setTexture(texture);
// update rect
_rectRotated = spriteFrame->isRotated();
setTextureRect(spriteFrame->getRect(), _rectRotated, spriteFrame->getOriginalSize());
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
if (spriteFrame->hasPolygonInfo())
{
2021-12-25 10:04:45 +08:00
_polyInfo = spriteFrame->getPolygonInfo();
_renderMode = RenderMode::POLYGON;
2021-12-25 10:04:45 +08:00
if (_flippedX)
flipX();
if (_flippedY)
flipY();
updateColor();
}
if (spriteFrame->hasAnchorPoint())
setAnchorPoint(spriteFrame->getAnchorPoint());
if (spriteFrame->hasCenterRect())
setCenterRect(spriteFrame->getCenterRect());
}
2021-12-26 23:26:34 +08:00
void Sprite::setDisplayFrameWithAnimationName(std::string_view animationName, unsigned int frameIndex)
{
2022-07-16 10:43:05 +08:00
AXASSERT(!animationName.empty(), "CCSprite#setDisplayFrameWithAnimationName. animationName must not be nullptr");
2015-12-16 11:53:59 +08:00
if (animationName.empty())
return;
Scale9Sprite refactor (#16891) * Squashed commit of the following: commit 026eee59c9ece7fc59d71fead41104f375f72eb5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 21:45:12 2016 -0800 yay! everything works! commit a645c99d44f0d7674e6238afae7628d8d2a030b1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 22 14:55:31 2016 -0800 more fixes in Scale9Sprite commit 3a688f4ea70c0abe311232c65ed14a7e9acc7611 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 23:06:45 2016 -0800 rotated sprites commit 45e2085df3aa4b52236c817f7db7c1f6602c1e95 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 17:10:44 2016 -0800 android patch 9: fixes is not 100% backward compatible since the previous version had some artifacts. fixed the artifacts. now it renders ok commit 4655d894387fa40a7e63b074a36bfed20e41d5f9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 21 16:31:29 2016 -0800 sprite: correct size for "fake scale9" commit cb98aba27cc1c82a986268d5b74afb55b6cca2f3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 21:55:51 2016 -0800 sprite: adds setStrechEnabled for backward compatibility and other fixes commit c0fe67aac54cd62e3846810d56f87133f3a7343b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:49:42 2016 -0800 implemts missing functions in scale9sprite commit e471ef318725ccabc9eca2c062e285e9ca4f9a81 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Nov 18 18:42:30 2016 -0800 "batched" works commit 33124bfb14d1f275d4b0ffca8989975625a8a76d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:59:38 2016 -0800 more fixes commit 149f8206269843af63a1739885c00ed8d94c239c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 18:37:12 2016 -0800 scale 9 rotated not fixed yet. but making progress commit 27f98275d94ce00c8d5ff0b6f74b5c22723cc3c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 15:32:57 2016 -0800 sprite: streching works ok with normal sprites commit 2519498cac8b77a32dee5bdf1805be56fbda5ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 16 12:12:28 2016 -0800 somes fixes... still not working commit 43580d0b4aa976b0200717611a286bf1035c472d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 23:15:22 2016 -0800 more bug fixes related to untrimmed setCenterRect... ...in SCale9Sprite commit 407247616e506afaa0415c58ad7fce38efed0cd9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 15 22:13:38 2016 -0800 spritecale9: untrimmed vs. trimmed capInsets WIP. there still a few bugs commit 3d845b2af3500be287fabb04bb6ba0ec04dbb401 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 23:11:17 2016 -0800 started progressbar commit 0a44b00daf723869b7105689890f29cd53a62608 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 14 17:43:23 2016 -0800 adds EditBox test commit 330304bd9b2e762de95c2f27f1ae3ceee83b2fbf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 16:57:08 2016 -0800 adds elastic to scroll view commit a06a35f8691ff56a143953c44acd947b519150b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:58:29 2016 -0800 yay! scrollview works commit 37748a885c62eca8c00d2c9c11ee103f1d95e71c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 15:33:58 2016 -0800 yet more scrollview fixes commit a6e563b497adef7b141ac7c92c844d479b244c59 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 9 14:48:28 2016 -0800 initial scroll view commit 4243edd7548e5533ca03c26d5042f8dc5517445a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Nov 8 17:50:15 2016 -0800 sanity check in frames. missing files commit 159d88603ad22f3c01761b60bacec98d52b9041d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 19:21:00 2016 -0800 three buttons working commit 6764cfc7937a1a81d6993d5e32a21f17457b8e0d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:50:22 2016 -0800 missing files commit 11c1fa3812e706a7d34137fe2626f05ab73ee3e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:49:59 2016 -0800 button works! commit 26b6de4c28fc973e332dd51fcd763a6249c0b4c2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 18:19:47 2016 -0800 Scale9: more fixes. complies with odd Rect::ZERO behavior commit ce561268096afe322f25034eeab3508a60027afd Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Nov 7 11:50:42 2016 -0800 label: setTitleLabel commit 51b5536cd2af36896002621f75c7310960c3f5e7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 17:41:08 2016 -0700 UIButton kind of working commit 7562a49a761ef70c383a99d2addefc63d77e279f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 11:11:42 2016 -0700 missing resoruces commit a9890dee5da0104bff6872cc04e8786a6c0a9018 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 10:54:55 2016 -0700 setCenterRect to .cpp file commit c9c4bb55ed3fc55709eca46c43d1bfe5301c317f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Nov 2 00:19:51 2016 -0700 removed unused paramter commit e47732934cca79c08e6fe96e46ebdf075508e568 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 18:19:31 2016 -0700 flipping works! commit c9769bacd321aeddf84e1772dd270f12194d2f04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 17:57:53 2016 -0700 spirte flip fixes... not finished yet commit 1cbdc8e12cc6d0d2728c06dfabaada001784a178 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:53:16 2016 -0700 centerRect changes commit aeb1b14c00331dabba640f52d79ab0e255fa3407 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 28 09:10:41 2016 -0700 changes from v3 commit e7a61c4a20d786c2bc1d6f57e33bf3ac95cb6f21 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 17:01:15 2016 -0700 sprite: rotated slice 9 works as expected commit 91049389426051deb49a9d951364bf60abaf4532 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 15:39:54 2016 -0700 more bug fixes in scale9sprite support commit 9feb12449078441c439df16dc7bcfb4506c7a226 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 13:22:52 2016 -0700 Android's Patch 9 works as expected commit 1cf46afe3e7f7f5f714d30779caefc25a9bb1b3b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 26 10:18:47 2016 -0700 Sprite: uses capInsets instead of centerRect just to share the same API as Scale9Sprite commit e944fa0248a7eb58012aacb229de1a9b814e0aef Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 18:59:42 2016 -0700 scale9sprite support fixes commit b08765740d480b6ae1491800161b40d88f458767 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:38:47 2016 -0700 more scale9sprite fixes commit 388a34d93de5e6007a2cecea959c929f26427cab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 25 17:20:01 2016 -0700 UI::Scale9Sprite refactoring subclass of Sprite... much cleaner! commit c84ec8ee654f74d4b38be2d0a3d7ffe6adbc6faf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 20:58:36 2016 -0700 supports tiled sprites commit d2b18eb47a647b29319488bd53edac9f304acb84 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 19:21:57 2016 -0700 testing tiled sprite commit b4832ab2facc01cbb624db587ede01fe7acf23e8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:53:19 2016 -0700 using correct top-left coordinates for setCenterRect commit 29d8de86a71cc597b2338f59f7951a28ee0c93b2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Oct 24 16:46:13 2016 -0700 fixes from scale_sprite9 branch commit ccbe1063bea7db75397ecaf9046aac3dd977a621 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 19:01:50 2016 -0700 updated example commit 24f7f85d4eba80f8e543810dcbc1a02447900bdc Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:47:28 2016 -0700 more fixes in nine slice commit df3358fae68f2d81baf3a8cbe033a4c400ea50da Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 18:22:14 2016 -0700 anchor point fixes commit 4ac7409bc72425abb0dc747b956ec346fbd1b2fa Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 17:01:48 2016 -0700 support for slice-9 from creator commit a3221375d3a9defc2e03df0b1c2da1b36dfdd491 Merge: 73e5389 d7490d9 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 20 14:13:38 2016 -0700 Merge branch 'sprite_scale9' into creator_cpp_support commit d7490d94896ad0ce8705dc0695252cee34329b5e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 13 14:34:52 2016 -0700 Adds slice9 support for Sprite. how to use it: // points coords sprite->setCenterRect(Rect(x,y,w,h)); // normalized coords sprite->setCenterRectNormalized(Rect(x,y,w,h)); starts scale9sprite in sprite more slice 9 changes sprite 9 slice works? kind of works correct anchor point slice 9 works, at least with non-rotated atlases streched works ok better Y invert code. cleaner, compatible with the previous code yay, scaling workings... need a better api now sets scale correctly yay! works as expected! more fixes and tests better test for box setContentSize() changes size in non-9-slice mode sprites as well setCenterRect() -> setCenterRectNormalized() yet another test adds setPositionNormalized() adds setCenterRect() tests remove devel team from xcode tests: add one more tests fun test! improved test yet another test for slice 9 commit 73e5389ef719880096067d0f7d0bffd6e1f3cfd1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sun Oct 9 18:54:22 2016 -0700 kind of ProgressBar support commit 4db5e9e7369e93ceba1d9512ab88c26b843c43d5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Oct 7 16:23:54 2016 -0700 new generatred ui files commit 75aa06f3d39df8c6aa898d5e6810b3cd8015c07b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Oct 6 10:44:59 2016 -0700 bette canvas support commit 89beacac478fc7f58ef930963b6393f3da4a743c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 21:47:11 2016 -0700 sprites tests commit 5fe930ad50c2c1b6d868982709c7b659176f9889 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:35:44 2016 -0700 more label tests commit d3f615a097d080d78f2ebd95f3e2388da45f92db Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Oct 5 18:08:24 2016 -0700 label tests commit 2a4018922ce8d36117f7092fc324e37cf75fdeab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 21:52:56 2016 -0700 label fixes commit 41fafbd023de63e376d014311605f2b156add307 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 19:14:58 2016 -0700 updated test commit 06919fc28fffbc5a20cd14bdcc2ad2ff997e0da1 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Oct 4 18:50:45 2016 -0700 creator tests: works commit 6e362e7cc7f68dc216b569a7f7f90aaa110c0e4a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 27 23:15:56 2016 -0700 autogen: new data commit e78078b2ad84b4e364827a66f1c459de7384a91d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 26 18:18:57 2016 -0700 fix: initial test for CPP support for Creator * adds more documentation * adds more documentation
2016-11-24 09:59:00 +08:00
2021-12-25 10:04:45 +08:00
Animation* a = AnimationCache::getInstance()->getAnimation(animationName);
2022-07-16 10:43:05 +08:00
AXASSERT(a, "CCSprite#setDisplayFrameWithAnimationName: Frame not found");
AnimationFrame* frame = a->getFrames().at(frameIndex);
2022-07-16 10:43:05 +08:00
AXASSERT(frame, "CCSprite#setDisplayFrame. Invalid frame");
setSpriteFrame(frame->getSpriteFrame());
}
2021-12-25 10:04:45 +08:00
bool Sprite::isFrameDisplayed(SpriteFrame* frame) const
{
Rect r = frame->getRect();
2021-12-25 10:04:45 +08:00
return (r.equals(_rect) && frame->getTexture() == _texture &&
frame->getOffset().equals(_unflippedOffsetPositionFromCenter));
}
SpriteFrame* Sprite::getSpriteFrame() const
{
if (nullptr != this->_spriteFrame)
return this->_spriteFrame;
2022-07-15 19:17:01 +08:00
return SpriteFrame::createWithTexture(_texture, AX_RECT_POINTS_TO_PIXELS(_rect), _rectRotated,
AX_POINT_POINTS_TO_PIXELS(_unflippedOffsetPositionFromCenter),
AX_SIZE_POINTS_TO_PIXELS(_originalContentSize));
}
SpriteBatchNode* Sprite::getBatchNode() const
{
return _batchNode;
}
2021-12-25 10:04:45 +08:00
void Sprite::setBatchNode(SpriteBatchNode* spriteBatchNode)
{
2021-12-25 10:04:45 +08:00
_batchNode = spriteBatchNode; // weak reference
// self render
2021-12-25 10:04:45 +08:00
if (!_batchNode)
{
if (_renderMode != RenderMode::SLICE9)
_renderMode = RenderMode::QUAD;
_atlasIndex = INDEX_NOT_INITIALIZED;
setTextureAtlas(nullptr);
_recursiveDirty = false;
setDirty(false);
float x1 = _offsetPosition.x;
float y1 = _offsetPosition.y;
float x2 = x1 + _rect.size.width;
float y2 = y1 + _rect.size.height;
2021-12-25 10:04:45 +08:00
_quad.bl.vertices.set(x1, y1, 0);
_quad.br.vertices.set(x2, y1, 0);
_quad.tl.vertices.set(x1, y2, 0);
_quad.tr.vertices.set(x2, y2, 0);
}
else
{
// using batch
2021-12-25 10:04:45 +08:00
_renderMode = RenderMode::QUAD_BATCHNODE;
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
_transformToBatch = Mat4::IDENTITY;
2021-12-25 10:04:45 +08:00
setTextureAtlas(_batchNode->getTextureAtlas()); // weak ref
}
}
// MARK: Texture protocol
void Sprite::updateBlendFunc()
{
2022-07-16 10:43:05 +08:00
AXASSERT(_renderMode != RenderMode::QUAD_BATCHNODE,
2021-12-25 10:04:45 +08:00
"CCSprite: updateBlendFunc doesn't work when the sprite is rendered using a SpriteBatchNode");
2015-09-09 11:37:41 +08:00
// it is possible to have an untextured sprite
metal support for cocos2d-x (#19305) * remove deprecated files * remove some deprecated codes * remove more deprecated codes * remove ui deprecated codes * remove more deprecated codes * remove deprecated codes in ccmenuitem * remove more deprecated codes in ui * remove more deprecated codes in ui * remove more deprecated codes in ui * remove more deprecated codes * remove more deprecated codes * remove more deprecated codes * remove vr related codes and ignore some modules * remove allocator * remove some config * 【Feature】add back-end project file * [Feature] add back-end file * add pipeline descriptor and shader cache * [Feature] support sprite for backend * [Feature] remove unneeded code * [Feature] according to es2.0 spec, you must use clamp-to-edge as texture wrap mode, and no mipmapping for non-power-of-two texture * [Feature] set texture wrap mode to clamp-to-edge, and no mipmapping for non-power-of-two texture * [Feature] remove macro define to .cpp file * [Feature] add log info * [Feature] add PipelineDescriptor for TriangleCommand * [Feature] add PipelineDescriptor object as member of TriangleCommand * [Feature] add getPipelineDescriptor method * add renderbackend * complete pipeline descriptor * [Feature] add viewport in RenderCommand * set viewport when rendrering * [Feature] occur error when using RendererBackend, to be fixed. * a workaround to fix black screen on macOS 10.14 (#19090) * add rendererbackend init function * fix typo * [Feature] modify testFile * [BugFix] modify shader path * [Feature] set default viewport * fix projection * [Feature] modify log info * [BugFix] change viewport data type to int * [BugFix] add BindGroup to PipelienDescriptor * [BugFix] change a_position to vec3 in sprite.vert * [BugFix] set vertexLayout according to V3F_C4B_T2F structure * [Feature] revert a_position to vec4 * [Feature] renderer should not use gl codes directly * [Feature] it's better not use default value parameter * fix depth test setting * rendererbackend -> renderer * clear color and depth at begin * add metal backend * metal support normalized attribute * simplify codes * update external * add render pass desctriptor in pipeline descriptor * fix warnings * fix crash and memeory leak * refactor Texture2D * put pipeline descriptor into render command * simplify codes * [Feature] update Sprite * fix crash when closing app * [Feature] update SpriteBatchNode and TextureAtlas * support render texture(not finish) * [Feature] remove unused code * make tests work on mac * fix download-deps path error * make tests work on iOS * [Feature] support ttf under normal label effect * refactor triangle command processing * let renderer handle more common commands * refactor backend * make render texture work * [Feature] refactor backend for GL * [Feature]Renaming to make it easy to understand * [Feature] change warp mode to CLAMP_TO_EDGE * fix ghost * simplify visit render queue logic * support progress timer without rial mode * support partcile system * Feature/update label (#149) * [BugFix] fix compile error * [Feature] support outline effect in ios * [Feature] add shader file * [BugFix] fix begin and end RenderPass * [Feature] update CustomCommand * [Feature] revert project.pbxproj * [Feature] simplify codes * [BugFix] pack AI88 to RGBA8888 only when outline enable * [Feature] support shadow effect in Label * [Feature] support BMFont * [Feature] support glow effect * [Feature] simplify shader files * LabelAtlas work * handle blend function correctly * support tile map * don't share buffer in metal * alloc buffer size as needed * support more tilemap * Merge branch 'minggo/metal-support' into feature/updateLabel * minggo/metal-support: support tile map handle blend function correctly LabelAtlas work Feature/update label (#149) support partcile system # Conflicts: # cocos/2d/CCLabel.cpp # cocos/2d/CCSprite.cpp # cocos/2d/CCSpriteBatchNode.cpp # cocos/renderer/CCQuadCommand.cpp # cocos/renderer/CCQuadCommand.h * render texture work without saving file * use global viewport * grid3d works * remove grabber * tiled3d works * [BugFix] fix label bug * [Feature] add updateSubData for buffer * [Feature] remove setVertexCount * support depth test * add callback command * [Feature] add UITest * [Feature] update UITest * [Feature] remove unneeded codes * fix custom command issue * fix layer color blend issue * [BugFix] fix iOS compile error * [Feature] remove unneeded codes * [Feature] fix updateVertexBuffer * layerradial works * add draw test back * fix batch issue * fix compiling error * [BugFix] support ETC1 * [BugFix] get the correct pipelineDescriptor * [BugFix] skip draw when backendTexture nullptr * clipping node support * [Feature] add shader files * fix stencil issue in metal * [Feature] update UILayoutTest * [BugFix] skip drawing when vertexCount is zero * refactor renderer * add set global z order for stencil manager commands * fix warnings caused by type * remove viewport in render command * [Feature] fix warnings caused by type * [BugFix] clear vertexCount and indexCount for CustomComand when needed * [Feature] update clear for CustomCommand * ios use metal * fix viewport issue * fix LayerColorGradient crash * [cmake] transport to android and windows (#160) * save point 1 * compile on windows * run on android * revert useless change * android set CC_ENABLE_CACHE_TEXTURE_DATA to 1 * add initGlew * fix android crash * add TODO new-renderer * review update * revert onGLFWWindowPosCallback * fix android compiling error * Impl progress radial (#162) * progresstimer add radial impl * default drawType to element * dec invoke times of createVertexBuffer (#163) * support depth/stencil format for gl backend * simplify progress timer codes * support motionstreak, effect is wrong * fix motionstreak issue * [Feature] update Scissor Test (#161) * [Feature] update Scissor Test * [Feature] update ScissorTest * [Feature] rename function * [Feature] get constant reference if needed * [Feature] show render status (#164) * improve performance * fix depth state * fill error that triangle vertex/index number bigger than buffer * fix compiline error in release mode * fix buffer conflict between CPU and GPU on iOS/macOS * Renderer refactor (#165) * use one vertes/index buffer with opengl * fix error on windows * custom command support index format config * CCLayer: compact vertex data structure * update comment * fix doc * support fast tilemap * pass index format instead * fix some wrong effect * fix render texture error * fix texture per-element size * fix texture format error * BlendFunc type refactor, GLenum -> backend::BlendFactor (#167) * BlendFunc use backend::BlendFactor as inner field * update comments * use int to replace GLenum * update xcode project fiel * rename to GLBlendConst * add ccConstants.h * update xcode project file * update copyright * remove primitive command * remove CCPrimitive.cpp/.h * remove deprecated files * remove unneeded files * remove multiple view support * remove multiple view support * remove the usage of frame buffer in camera * director don't use frame buffer * remove FrameBuffer * remove BatchCommand * add some api reference * add physics2d back * fix crash when close app on mac * improve render texture * fix rendertexture issue * fix rendertexture issue * simplify codes * CMake support for mac & ios (#169) * update cmake * fix compile error * update 3rd libs version * remove CCThread.h/.cpp * remove ccthread * use audio engine to implement simple audio engine * remove unneeded codes * remove deprecated codes * remove winrt macro * remove CC_USE_WIC * set partcile blend function in more elegant way * remove unneeded codes * remove unneeded codes * cmake works on windows * update project setting * improve performance * GLFloat -> float * sync v3 cmake improvements into metal-support (#172) * pick: modern cmake, compile definitions improvement (#19139) * modern cmake, use target_compile_definitions partly * simplify macro define, remove USE_* * modern cmake, macro define * add physics 2d macro define into ccConfig.h * remove USE_CHIPMUNK macro in build.gradle * remove CocosSelectModule.cmake * shrink useless define * simplify compile options config, re-add if necessary * update external for tmp CI test * un-quote target_compile_options value * add "-g" parameter only when debug mode * keep single build type when generator Xcode & VS projecy * update external for tmp CI tes * add static_cast<char>(-1), fix -Wc++11-narrowing * simplify win32 compile define * not modify code, only improve compile options # Conflicts: # .gitignore # cmake/Modules/CocosConfigDepend.cmake # cocos/CMakeLists.txt # external/config.json # tests/cpp-tests/CMakeLists.txt * modern cmake, improve cmake_compiler_flags (#19145) * cmake_compiler_flags * Fix typo * Fix typo2 * Remove chanages from Android.mk * correct lua template cmake build (#19149) * don't add -Wno-deprecated into jsb target * correct lua template cmake build * fix win32 lua template compile error * prevent cmake in-source-build friendly (#19151) * pick: Copy resources to "Resources/" on win32 like in linux configuration * add "/Z7" for cpp-tests on windows * [cmake] fix iOS xcode property setting failed (#19208) * fix iOS xcode property setting failed * use search_depend_libs_recursive at dlls collect * fix typo * [cmake] add find_host_library into iOS toolchain file (#19230) * pick: [lua android] use luajit & template cmake update (#19239) * increase cmake stability , remove tests/CMakeLists.txt (#19261) * cmake win32 Precompiled header (#19273) * Precompiled header * Fix * Precompiled header for cocos * Precompiled header jscocos2d * Fix for COCOS2D_DEBUG is always 1 on Android (#19291) Related #19289 * little build fix, tests cpp-tests works on mac * sync v3 build related codes into metal-support (#173) * strict initialization for std::array * remove proj.win32 project configs * modern cmake, cmake_cleanup_remove_unused_variables (#19146) * Switch travis CI to xenial (#19207) * Switch travis CI to xenial * Remove language: android * Set language: cpp * Fix java problem * Update sdkmanager * Fix sdkmanger * next sdkmanager fix * Remove xenial from android * revert to sdk-tools-{system}-3859397 * Remove linux cmake install * Update before-install.sh * Update .travis.yml * Simplify install-deps-linux.sh, tested on Ubuntu 16.04 (#19212) * Simplify install-deps-linux.sh * Cleanup * pick: install ninja * update cocos2d-console submodule * for metal-support alpha release, we only test cpp * add HelloCpp into project(Cocos2d-x) for tmp test * update extenal metal-support-4 * update uniform setting * [Feature] update BindGroup * [Feature] empty-test * [Feature] cpp-test * [Feature] fix GL compiler error * [Feature] fix GL crash * [Feature] empty-test * [Feature] cpp-tests * [feature] improve frameRate * [feature] fix opengl compile error * [feature] fix opengl compile error * [BugFix] fix compute maxLocation error * [Feature] update setting unifrom * [Feature] fix namespace * [Feature] remove unneeded code * [Bugfix] fix project file * [Feature] update review * [texture2d] impl texture format support (#175) * texture update * update * update texture * commit * compile on windows * ddd * rename * rename methods * no crash * save gl * save * save * rename * move out pixel format convert functions * metal crash * update * update android * support gles compressed texture format * support more compress format * add more conversion methods * ss * save * update conversion methods * add PVRTC format support * reformat * add marco linux * fix GL marcro * pvrtc supported only by ios 8.0+ * remove unused cmake * revert change * refactor Texture2D::initWithData * fix conversion log * refactor Texture2D::initWithData * remove some OpenGL constants for PVRTC * add todo * fix typo * AutoTest works on mac/iOS by disable part cases, sync v3 bug fix (#174) * review cpp-tests, and fix part issues on start auto test * sync png format fix: Node:Particle3D abnormal texture effects #19204 * fix cpp-tests SpritePolygon crash, wrong png format (#19170) * fix wrong png convert format from sRGB to Gray * erase plist index if all frames was erased * test_A8.png have I8 format, fix it * [CCSpriteCache] allow re-add plist & add testcase (#19175) * allow re-add plist & add testcase * remove comments/rename method/update testcase * fix isSpriteFramesWithFileLoaded & add testcase * remove used variable * remove unused variable * fix double free issues when js/lua-tests exit on iOS (#19236) * disable part cases, AutoTest works without crash on mac * update cocos2dx files json, to test cocos new next * fix spritecache plist parsing issue (#19269) * [linux] Fix FileUtils::getContents with folder (#19157) * fix FileUtils::getContents on linux/mac * use stat.st_mode * simplify * [CCFileUtils] win32 getFileSize (#19176) * win32 getFileSize * fix stat * [cpp test-Android]20:FileUtils/2 change title (#19197) * sync #19200 * sync #19231 * [android lua] improve performance of lua loader (#19234) * [lua] improve performance of lua loader * remove cache fix * Revert "fix spritecache plist parsing issue (#19269)" This reverts commit f3a85ece4307a7b90816c34489d1ed2c8fd11baf. * remove win32 project files ref in template.json * add metal framework lnk ref into cpp template * test on iOS, and disable part cases * alBufferData instead of alBufferDataStatic for small audio file on Apple (#19227) * changes AudioCache to use alBufferData instead of alBufferDataStatic (also makes test 19 faster to trigger openal bugs faster) The original problem: CrashIfClientProvidedBogusAudioBufferList https://github.com/cocos2d/cocos2d-x/issues/18948 is not happening anymore, but there's still a not very frequent issue that makes OpenAL crash with a call stack like this. AudioCache::readDataTask > alBufferData > CleanUpDeadBufferList It happes more frequently when the device is "cold", which means after half an hour of not using the device (locked). I could not find the actual source code for iOS OpenAL, so I used the macOS versions: https://opensource.apple.com/source/OpenAL/OpenAL-48.7/Source/OpenAL/oalImp.cpp.auto.html They seem to use CAGuard.h to make sure the dead buffer list has no threading issues. I'm worried because the CAGuard code I found has macos and win32 define but no iOS, so I'm not sure. I guess the iOS version is different and has the guard. I could not find a place in the code that's unprotected by the locks except the InitializeBufferMap() which should not be called more than once from cocos, and there's a workaround in AudioEngine-impl for it. I reduced the occurence of the CleanUpDeadBufferList crash by moving the guard in ~AudioCache to cover the alDeleteBuffers call. * remove hack method "setTimeout" on audio * AutoTest works on iOS * support set ios deployment target for root project * enable all texture2d cases, since Jiang have fixed * add CCTextureUtils to xcode project file (#176) * add leak cases for SpriteFrameCache (#177) * re-add SpriteFrameCache cases * update template file json * Update SpriteFrameCacheTest.cpp * fix compiling error
2019-01-18 15:08:25 +08:00
backend::BlendDescriptor& blendDescriptor = _trianglesCommand.getPipelineDescriptor().blendDescriptor;
2021-12-25 10:04:45 +08:00
blendDescriptor.blendEnabled = true;
if (!_texture || !_texture->hasPremultipliedAlpha())
{
_blendFunc = BlendFunc::ALPHA_NON_PREMULTIPLIED;
setOpacityModifyRGB(false);
}
else
{
_blendFunc = BlendFunc::ALPHA_PREMULTIPLIED;
setOpacityModifyRGB(true);
}
}
std::string Sprite::getDescription() const
{
char textureDescriptor[100];
2017-01-11 21:33:41 +08:00
if (_renderMode == RenderMode::QUAD_BATCHNODE)
2021-12-25 10:04:45 +08:00
sprintf(textureDescriptor, "<Sprite | Tag = %d, TextureID = %p>", _tag,
_batchNode->getTextureAtlas()->getTexture()->getBackendTexture());
else
sprintf(textureDescriptor, "<Sprite | Tag = %d, TextureID = %p>", _tag, _texture->getBackendTexture());
2021-12-25 10:04:45 +08:00
return textureDescriptor;
}
const PolygonInfo& Sprite::getPolygonInfo() const
2015-06-04 15:43:31 +08:00
{
2015-06-04 16:20:00 +08:00
return _polyInfo;
2015-06-04 15:43:31 +08:00
}
void Sprite::setPolygonInfo(const PolygonInfo& info)
{
2021-12-25 10:04:45 +08:00
_polyInfo = info;
_renderMode = RenderMode::POLYGON;
2015-06-04 15:43:31 +08:00
}
void Sprite::setMVPMatrixUniform()
{
2021-02-05 23:09:14 +08:00
const auto& projectionMat = _director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION);
2021-12-25 10:04:45 +08:00
auto programState = _trianglesCommand.getPipelineDescriptor().programState;
2019-03-26 13:45:03 +08:00
if (programState && _mvpMatrixLocation)
programState->setUniform(_mvpMatrixLocation, projectionMat.m, sizeof(projectionMat.m));
}
NS_AX_END