Quantcast
Channel: Cocos Forums - Latest topics
Viewing all 17118 articles
Browse latest View live

enableOutline issue with Label::createWithSystemFont

$
0
0

cocos2dx version 3.17
only on iOS, not on android

I created Label node with standard system font, with CJK strings and when I enable Ounline on it,
the outline is not correct in some cases.

I write code below at just before “return true” in a basic Helloworld::init
and ran on ipad (7th generation) simulator.

std::vectorstd::string aStrings;
aStrings.push_back(“CLEAR STAGES TO GET\nMORE SUPPORT UNIT”); // en
aStrings.push_back(“ステージをクリアして\nサポートユニットを増やしましょう”); // jp
aStrings.push_back(“完成关卡以获取\n更多支持单元”); // zh-cn
aStrings.push_back(“ユニットを増や”);
aStrings.push_back(“ユニットを増”);
aStrings.push_back(“ユニットを増aaa”);
aStrings.push_back(“を増やしましょう”);
aStrings.push_back(“増やしましょう”);
aStrings.push_back(“aaaa増やしましょう”);
aStrings.push_back(“を増や”);
aStrings.push_back(“更多支持单元”);
aStrings.push_back(“更多支持单”);

for ( int k=0; k< aStrings.size(); k++) {
auto eachString = aStrings.at(k);

// without outline
auto aLabel = Label::createWithSystemFont(eachString, “”, 8);
aLabel->setAlignment(TextHAlignment::CENTER);
aLabel->setPosition(120, 300 - k*24);
addChild(aLabel);

// with outline
aLabel = Label::createWithSystemFont(eachString, “”, 8);
aLabel->setAlignment(TextHAlignment::CENTER);
aLabel->enableOutline(Color4B::RED, 2);
aLabel->setPosition(360, 300 - k*24);
addChild(aLabel);
}

after some experiment, I found some rule about this issue:

ステージをクリアして\nサポートユニットを増やしましょう
-> in this string, “増” is not a standard font and the problem occurs around this letter.

ユニットを増や
ユニットを増
-> if there is any letter AFTER non-standard font, the outline is not correct

を増やしましょう
増やしましょう
-> if there is any letter BEFORE non-standard font, the outline is not correct

を増や
-> if there is any letter before and after non-standard font, the outline is not correct

ユニットを増aaa
aaaa増やしましょう
-> this rule does not apply on ascii letters.

更多支持单元
更多支持单
-> I guess the problem letter is “单”

1 post - 1 participant

Read full topic


cocos creator 2.4.2 How to load facebook profile picture

$
0
0

Hi,
I’m newbie in cocos creator. I try to load facebook profile picture but cc.assetManager.loadRemote not return a texture if remoteUrl don’t have extension.
This is my code.

let self = this;
let remoteUrl = “https://graph.facebook.com/” + UserData.facebookUserId + “/picture?type=large&width=100&height=100”;
assetManager.loadRemote(remoteUrl, {type: ‘jpg’}, function (err, texture) {
self.spPicture.spriteFrame = new cc.SpriteFrame(texture);
});

1 post - 1 participant

Read full topic

Flappy bird clone

$
0
0

I created a Flappybird clone with cocos2dx.
It might be useful for other to poke and read. Here is the source: FlappyBird. Its not fully commented but I tried to put comment wherever I thought it may be useful.

1 post - 1 participant

Read full topic

Couldn't Download Old Version

$
0
0

Dear Cocos Team,

I couldn’t download old version of Cocos Creator.
I’m in trouble now as I moved to a new workstation and needed to work on old projects.

Please kindly help!

For. v2.1.0, I tried the link given at the forum and the web site, but both of them were down.

https://www.cocos.com/en/creator/download

2 posts - 1 participant

Read full topic

MacOS Android Build Failed

$
0
0

Dear Cocos Team and Gurus,

I’m testing Cocos Creator v2.4.2 on MacOS Catalina.
I couldn’t make the compile process work although I tried for hours.
So, I do need your professional helps.

Platforms

Cocos Creator: v2.4.2 (also tried with 2.1.0)
OS: MacOS Catalina

Development Environment

Java: java version “1.8.0_261”
Java™ SE Runtime Environment (build 1.8.0_261-b12)
Java HotSpot™ 64-Bit Server VM (build 25.261-b12, mixed mode)

Android Studio: 4.0.1

SDKs: 16, 26, 27, 28, 30
Screenshot 2020-08-10 at 1.21.31 PM

SDK Tools:
Android SDK Build-Tools 30.0.1
Android SDK Platform-Tools 30.0.4
Android SDK Command-line Tools (latest)
NDK: 19C
Screenshot 2020-08-10 at 1.30.48 PM

Python: 2.7.18

Xcode: 11.6

Project: Default HelloWorld Project (Nothing Special)

CocosCreator Settings:
Native Develop: Checked
Build Settings: As Follow

Build: Success, Compile: Failed

Log: native.log file contents

Building mode: release
Using Android Studio project : /Volumes/Data/Playground/MacOSTestBuild/build/jsb-default/frameworks/runtime-src/proj.android-studio
Building apk...
running: '"/Volumes/Data/Playground/MacOSTestBuild/build/jsb-default/frameworks/runtime-src/proj.android-studio/gradlew" --parallel --info assembleRelease'

Initialized native services in: /Users/zerohacker/.gradle/native
Removing 0 daemon stop events from registry
Starting a Gradle Daemon (subsequent builds will be faster)
Starting process 'Gradle build daemon'. Working directory: /Users/zerohacker/.gradle/daemon/4.10.3 Command: /Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/Contents/Home/bin/java -XX:+HeapDumpOnOutOfMemoryError -Xmx1024m -Dfile.encoding=UTF-8 -Duser.country=GB -Duser.language=en -Duser.variant -cp /Users/zerohacker/.gradle/wrapper/dists/gradle-4.10.3-all/47sla2vl0tc5qooe1dsb59pe1r/gradle-4.10.3/lib/gradle-launcher-4.10.3.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 4.10.3
Successfully started process 'Gradle build daemon'
An attempt to start the daemon took 0.751 secs.
The client will now receive all logging from the daemon (pid: 8515). The daemon log file: /Users/zerohacker/.gradle/daemon/4.10.3/daemon-8515.out.log
Starting build in new daemon [memory: 954.7 MB]
Using 16 worker leases.
Starting Build
Compiling settings file '/Volumes/Data/Playground/MacOSTestBuild/build/jsb-default/frameworks/runtime-src/proj.android-studio/settings.gradle' using SubsetScriptTransformer.
Compiling settings file '/Volumes/Data/Playground/MacOSTestBuild/build/jsb-default/frameworks/runtime-src/proj.android-studio/settings.gradle' using BuildScriptTransformer.
Settings evaluated using settings file '/Volumes/Data/Playground/MacOSTestBuild/build/jsb-default/frameworks/runtime-src/proj.android-studio/settings.gradle'.
Projects loaded. Root project using build file '/Volumes/Data/Playground/MacOSTestBuild/build/jsb-default/frameworks/runtime-src/proj.android-studio/build.gradle'.
Included projects: [root project 'proj.android-studio', project ':game', project ':hello_world', project ':instantapp', project ':libcocos2dx']
Parallel execution is an incubating feature.

> Configure project :
Evaluating root project 'proj.android-studio' using build file '/Volumes/Data/Playground/MacOSTestBuild/build/jsb-default/frameworks/runtime-src/proj.android-studio/build.gradle'.
Compiling build file '/Volumes/Data/Playground/MacOSTestBuild/build/jsb-default/frameworks/runtime-src/proj.android-studio/build.gradle' using SubsetScriptTransformer.
Compiling build file '/Volumes/Data/Playground/MacOSTestBuild/build/jsb-default/frameworks/runtime-src/proj.android-studio/build.gradle' using BuildScriptTransformer.

> Configure project :game
Evaluating project ':game' using build file '/Volumes/Data/Playground/MacOSTestBuild/build/jsb-default/frameworks/runtime-src/proj.android-studio/game/build.gradle'.
Compiling build file '/Volumes/Data/Playground/MacOSTestBuild/build/jsb-default/frameworks/runtime-src/proj.android-studio/game/build.gradle' using SubsetScriptTransformer.
Compiling build file '/Volumes/Data/Playground/MacOSTestBuild/build/jsb-default/frameworks/runtime-src/proj.android-studio/game/build.gradle' using BuildScriptTransformer.
Creating configuration androidTestUtil
Creating configuration compile
Creating configuration publish
Creating configuration provided
Creating configuration api
Creating configuration implementation
Creating configuration runtimeOnly
Creating configuration compileOnly
Creating configuration wearApp
Creating configuration annotationProcessor
Creating configuration androidTestCompile
Creating configuration androidTestPublish
Creating configuration androidTestProvided
Creating configuration androidTestApi
Creating configuration androidTestImplementation
Creating configuration androidTestRuntimeOnly
Creating configuration androidTestCompileOnly
Creating configuration androidTestWearApp
Creating configuration androidTestAnnotationProcessor
Creating configuration testCompile
Creating configuration testPublish
Creating configuration testProvided
Creating configuration testApi
Creating configuration testImplementation
Creating configuration testRuntimeOnly
Creating configuration testCompileOnly
Creating configuration testWearApp
Creating configuration testAnnotationProcessor
Creating configuration debugCompile
Creating configuration debugPublish
Creating configuration debugProvided
Creating configuration debugApi
Creating configuration debugImplementation
Creating configuration debugRuntimeOnly
Creating configuration debugCompileOnly
Creating configuration debugWearApp
Creating configuration debugAnnotationProcessor
Creating configuration androidTestDebugCompile
Creating configuration androidTestDebugPublish
Creating configuration androidTestDebugProvided
Creating configuration androidTestDebugApi
Creating configuration androidTestDebugImplementation
Creating configuration androidTestDebugRuntimeOnly
Creating configuration androidTestDebugCompileOnly
Creating configuration androidTestDebugWearApp
Creating configuration androidTestDebugAnnotationProcessor
Creating configuration testDebugCompile
Creating configuration testDebugPublish
Creating configuration testDebugProvided
Creating configuration testDebugApi
Creating configuration testDebugImplementation
Creating configuration testDebugRuntimeOnly
Creating configuration testDebugCompileOnly
Creating configuration testDebugWearApp
Creating configuration testDebugAnnotationProcessor
Creating configuration releaseCompile
Creating configuration releasePublish
Creating configuration releaseProvided
Creating configuration releaseApi
Creating configuration releaseImplementation
Creating configuration releaseRuntimeOnly
Creating configuration releaseCompileOnly
Creating configuration releaseWearApp
Creating configuration releaseAnnotationProcessor
Creating configuration testReleaseCompile
Creating configuration testReleasePublish
Creating configuration testReleaseProvided
Creating configuration testReleaseApi
Creating configuration testReleaseImplementation
Creating configuration testReleaseRuntimeOnly
Creating configuration testReleaseCompileOnly
Creating configuration testReleaseWearApp
Creating configuration testReleaseAnnotationProcessor
Parsing the SDK, no caching allowed
Parsing /Users/zerohacker/Library/Android/sdk/build-tools/30.0.1/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/cmake/3.10.2.4988404/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/cmdline-tools/latest/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/emulator/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/google/auto/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/google/google_play_services/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/google/instantapps/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/google/market_apk_expansion/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/google/market_licensing/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/google/simulators/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/google/webdriver/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/intel/Hardware_Accelerated_Execution_Manager/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/ndk/17.2.4988734/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/ndk/18.1.5063045/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/ndk/19.2.5345600/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/patcher/v4/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/platform-tools/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/platforms/android-16/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/platforms/android-26/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/platforms/android-27/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/platforms/android-28/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/platforms/android-30/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/skiaparser/1/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/sources/android-16/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/sources/android-26/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/sources/android-27/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/sources/android-28/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/tools/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/build-tools/30.0.1/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/cmake/3.10.2.4988404/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/cmdline-tools/latest/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/emulator/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/google/auto/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/google/google_play_services/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/google/instantapps/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/google/market_apk_expansion/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/google/market_licensing/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/google/simulators/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/google/webdriver/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/intel/Hardware_Accelerated_Execution_Manager/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/ndk/17.2.4988734/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/ndk/18.1.5063045/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/ndk/19.2.5345600/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/patcher/v4/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/platform-tools/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/platforms/android-16/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/platforms/android-26/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/platforms/android-27/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/platforms/android-28/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/platforms/android-30/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/skiaparser/1/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/sources/android-16/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/sources/android-26/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/sources/android-27/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/sources/android-28/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/tools/package.xml
File /Users/zerohacker/.android/repositories.cfg could not be loaded.
Checking the license for package Android SDK Build-Tools 28.0.3 in /Users/zerohacker/Library/Android/sdk/licenses
License for package Android SDK Build-Tools 28.0.3 accepted.
Preparing "Install Android SDK Build-Tools 28.0.3 (revision: 28.0.3)".
"Install Android SDK Build-Tools 28.0.3 (revision: 28.0.3)" ready.
Installing Android SDK Build-Tools 28.0.3 in /Users/zerohacker/Library/Android/sdk/build-tools/28.0.3
"Install Android SDK Build-Tools 28.0.3 (revision: 28.0.3)" complete.
"Install Android SDK Build-Tools 28.0.3 (revision: 28.0.3)" finished.
Parsing /Users/zerohacker/Library/Android/sdk/build-tools/28.0.3/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/build-tools/30.0.1/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/cmake/3.10.2.4988404/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/cmdline-tools/latest/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/emulator/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/google/auto/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/google/google_play_services/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/google/instantapps/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/google/market_apk_expansion/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/google/market_licensing/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/google/simulators/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/google/webdriver/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/intel/Hardware_Accelerated_Execution_Manager/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/ndk/17.2.4988734/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/ndk/18.1.5063045/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/ndk/19.2.5345600/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/patcher/v4/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/platform-tools/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/platforms/android-16/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/platforms/android-26/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/platforms/android-27/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/platforms/android-28/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/platforms/android-30/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/skiaparser/1/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/sources/android-16/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/sources/android-26/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/sources/android-27/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/sources/android-28/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/tools/package.xml
SDK initialized in 12961 ms
Using incremental javac compilation for :game debugFeature.
Using incremental javac compilation for :game releaseFeature.
Using incremental javac compilation for :game debug.
Using incremental javac compilation for :game debugUnitTest.
Using incremental javac compilation for :game release.
Using incremental javac compilation for :game releaseUnitTest.
Using incremental javac compilation for :game debugAndroidTest.

> Configure project :hello_world
Evaluating project ':hello_world' using build file '/Volumes/Data/Playground/MacOSTestBuild/build/jsb-default/frameworks/runtime-src/proj.android-studio/app/build.gradle'.
Compiling build file '/Volumes/Data/Playground/MacOSTestBuild/build/jsb-default/frameworks/runtime-src/proj.android-studio/app/build.gradle' using SubsetScriptTransformer.
Compiling build file '/Volumes/Data/Playground/MacOSTestBuild/build/jsb-default/frameworks/runtime-src/proj.android-studio/app/build.gradle' using BuildScriptTransformer.
Creating configuration androidTestUtil
Creating configuration compile
Creating configuration apk
Creating configuration provided
Creating configuration api
Creating configuration implementation
Creating configuration runtimeOnly
Creating configuration compileOnly
Creating configuration wearApp
Creating configuration annotationProcessor
Creating configuration androidTestCompile
Creating configuration androidTestApk
Creating configuration androidTestProvided
Creating configuration androidTestApi
Creating configuration androidTestImplementation
Creating configuration androidTestRuntimeOnly
Creating configuration androidTestCompileOnly
Creating configuration androidTestWearApp
Creating configuration androidTestAnnotationProcessor
Creating configuration testCompile
Creating configuration testApk
Creating configuration testProvided
Creating configuration testApi
Creating configuration testImplementation
Creating configuration testRuntimeOnly
Creating configuration testCompileOnly
Creating configuration testWearApp
Creating configuration testAnnotationProcessor
Creating configuration debugCompile
Creating configuration debugApk
Creating configuration debugProvided
Creating configuration debugApi
Creating configuration debugImplementation
Creating configuration debugRuntimeOnly
Creating configuration debugCompileOnly
Creating configuration debugWearApp
Creating configuration debugAnnotationProcessor
Creating configuration androidTestDebugCompile
Creating configuration androidTestDebugApk
Creating configuration androidTestDebugProvided
Creating configuration androidTestDebugApi
Creating configuration androidTestDebugImplementation
Creating configuration androidTestDebugRuntimeOnly
Creating configuration androidTestDebugCompileOnly
Creating configuration androidTestDebugWearApp
Creating configuration androidTestDebugAnnotationProcessor
Creating configuration testDebugCompile
Creating configuration testDebugApk
Creating configuration testDebugProvided
Creating configuration testDebugApi
Creating configuration testDebugImplementation
Creating configuration testDebugRuntimeOnly
Creating configuration testDebugCompileOnly
Creating configuration testDebugWearApp
Creating configuration testDebugAnnotationProcessor
Creating configuration releaseCompile
Creating configuration releaseApk
Creating configuration releaseProvided
Creating configuration releaseApi
Creating configuration releaseImplementation
Creating configuration releaseRuntimeOnly
Creating configuration releaseCompileOnly
Creating configuration releaseWearApp
Creating configuration releaseAnnotationProcessor
Creating configuration testReleaseCompile
Creating configuration testReleaseApk
Creating configuration testReleaseProvided
Creating configuration testReleaseApi
Creating configuration testReleaseImplementation
Creating configuration testReleaseRuntimeOnly
Creating configuration testReleaseCompileOnly
Creating configuration testReleaseWearApp
Creating configuration testReleaseAnnotationProcessor
Parsing the SDK, no caching allowed
SDK initialized in 0 ms
Using incremental javac compilation for :hello_world debug.
Using incremental javac compilation for :hello_world debugUnitTest.
Using incremental javac compilation for :hello_world release.
Using incremental javac compilation for :hello_world releaseUnitTest.
Using incremental javac compilation for :hello_world debugAndroidTest.

> Configure project :instantapp
Evaluating project ':instantapp' using build file '/Volumes/Data/Playground/MacOSTestBuild/build/jsb-default/frameworks/runtime-src/proj.android-studio/instantapp/build.gradle'.
Compiling build file '/Volumes/Data/Playground/MacOSTestBuild/build/jsb-default/frameworks/runtime-src/proj.android-studio/instantapp/build.gradle' using SubsetScriptTransformer.
Compiling build file '/Volumes/Data/Playground/MacOSTestBuild/build/jsb-default/frameworks/runtime-src/proj.android-studio/instantapp/build.gradle' using BuildScriptTransformer.
Creating configuration androidTestUtil
Creating configuration compile
Creating configuration apk
Creating configuration provided
Creating configuration api
Creating configuration implementation
Creating configuration runtimeOnly
Creating configuration compileOnly
Creating configuration wearApp
Creating configuration annotationProcessor
Creating configuration debugCompile
Creating configuration debugApk
Creating configuration debugProvided
Creating configuration debugApi
Creating configuration debugImplementation
Creating configuration debugRuntimeOnly
Creating configuration debugCompileOnly
Creating configuration debugWearApp
Creating configuration debugAnnotationProcessor
Creating configuration releaseCompile
Creating configuration releaseApk
Creating configuration releaseProvided
Creating configuration releaseApi
Creating configuration releaseImplementation
Creating configuration releaseRuntimeOnly
Creating configuration releaseCompileOnly
Creating configuration releaseWearApp
Creating configuration releaseAnnotationProcessor
Parsing the SDK, no caching allowed
Parsing /Users/zerohacker/Library/Android/sdk/build-tools/28.0.3/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/build-tools/30.0.1/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/cmake/3.10.2.4988404/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/cmdline-tools/latest/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/emulator/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/google/auto/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/google/google_play_services/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/google/instantapps/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/google/market_apk_expansion/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/google/market_licensing/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/google/simulators/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/google/webdriver/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/intel/Hardware_Accelerated_Execution_Manager/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/ndk/17.2.4988734/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/ndk/18.1.5063045/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/ndk/19.2.5345600/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/patcher/v4/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/platform-tools/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/platforms/android-16/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/platforms/android-26/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/platforms/android-27/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/platforms/android-28/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/platforms/android-30/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/skiaparser/1/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/sources/android-16/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/sources/android-26/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/sources/android-27/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/sources/android-28/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/tools/package.xml
Checking the license for package Android SDK Build-Tools 28.0.2 in /Users/zerohacker/Library/Android/sdk/licenses
License for package Android SDK Build-Tools 28.0.2 accepted.
Preparing "Install Android SDK Build-Tools 28.0.2 (revision: 28.0.2)".
"Install Android SDK Build-Tools 28.0.2 (revision: 28.0.2)" ready.
Installing Android SDK Build-Tools 28.0.2 in /Users/zerohacker/Library/Android/sdk/build-tools/28.0.2
"Install Android SDK Build-Tools 28.0.2 (revision: 28.0.2)" complete.
"Install Android SDK Build-Tools 28.0.2 (revision: 28.0.2)" finished.
Parsing /Users/zerohacker/Library/Android/sdk/build-tools/28.0.2/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/build-tools/28.0.3/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/build-tools/30.0.1/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/cmake/3.10.2.4988404/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/cmdline-tools/latest/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/emulator/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/google/auto/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/google/google_play_services/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/google/instantapps/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/google/market_apk_expansion/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/google/market_licensing/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/google/simulators/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/google/webdriver/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/extras/intel/Hardware_Accelerated_Execution_Manager/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/ndk/17.2.4988734/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/ndk/18.1.5063045/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/ndk/19.2.5345600/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/patcher/v4/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/platform-tools/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/platforms/android-16/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/platforms/android-26/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/platforms/android-27/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/platforms/android-28/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/platforms/android-30/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/skiaparser/1/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/sources/android-16/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/sources/android-26/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/sources/android-27/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/sources/android-28/package.xml
Parsing /Users/zerohacker/Library/Android/sdk/tools/package.xml
SDK initialized in 11668 ms

> Configure project :libcocos2dx
Evaluating project ':libcocos2dx' using build file '/Volumes/Data/Playground/MacOSTestBuild/build/jsb-default/frameworks/cocos2d-x/cocos/platform/android/libcocos2dx/build.gradle'.
Compiling build file '/Volumes/Data/Playground/MacOSTestBuild/build/jsb-default/frameworks/cocos2d-x/cocos/platform/android/libcocos2dx/build.gradle' using SubsetScriptTransformer.
Compiling build file '/Volumes/Data/Playground/MacOSTestBuild/build/jsb-default/frameworks/cocos2d-x/cocos/platform/android/libcocos2dx/build.gradle' using BuildScriptTransformer.
Creating configuration androidTestUtil
Creating configuration compile
Creating configuration publish
Creating configuration provided
Creating configuration api
Creating configuration implementation
Creating configuration runtimeOnly
Creating configuration compileOnly
Creating configuration wearApp
Creating configuration annotationProcessor
Creating configuration androidTestCompile
Creating configuration androidTestPublish
Creating configuration androidTestProvided
Creating configuration androidTestApi
Creating configuration androidTestImplementation
Creating configuration androidTestRuntimeOnly
Creating configuration androidTestCompileOnly
Creating configuration androidTestWearApp
Creating configuration androidTestAnnotationProcessor
Creating configuration testCompile
Creating configuration testPublish
Creating configuration testProvided
Creating configuration testApi
Creating configuration testImplementation
Creating configuration testRuntimeOnly
Creating configuration testCompileOnly
Creating configuration testWearApp
Creating configuration testAnnotationProcessor
Creating configuration debugCompile
Creating configuration debugPublish
Creating configuration debugProvided
Creating configuration debugApi
Creating configuration debugImplementation
Creating configuration debugRuntimeOnly
Creating configuration debugCompileOnly
Creating configuration debugWearApp
Creating configuration debugAnnotationProcessor
Creating configuration androidTestDebugCompile
Creating configuration androidTestDebugPublish
Creating configuration androidTestDebugProvided
Creating configuration androidTestDebugApi
Creating configuration androidTestDebugImplementation
Creating configuration androidTestDebugRuntimeOnly
Creating configuration androidTestDebugCompileOnly
Creating configuration androidTestDebugWearApp
Creating configuration androidTestDebugAnnotationProcessor
Creating configuration testDebugCompile
Creating configuration testDebugPublish
Creating configuration testDebugProvided
Creating configuration testDebugApi
Creating configuration testDebugImplementation
Creating configuration testDebugRuntimeOnly
Creating configuration testDebugCompileOnly
Creating configuration testDebugWearApp
Creating configuration testDebugAnnotationProcessor
Creating configuration releaseCompile
Creating configuration releasePublish
Creating configuration releaseProvided
Creating configuration releaseApi
Creating configuration releaseImplementation
Creating configuration releaseRuntimeOnly
Creating configuration releaseCompileOnly
Creating configuration releaseWearApp
Creating configuration releaseAnnotationProcessor
Creating configuration testReleaseCompile
Creating configuration testReleasePublish
Creating configuration testReleaseProvided
Creating configuration testReleaseApi
Creating configuration testReleaseImplementation
Creating configuration testReleaseRuntimeOnly
Creating configuration testReleaseCompileOnly
Creating configuration testReleaseWearApp
Creating configuration testReleaseAnnotationProcessor
Parsing the SDK, no caching allowed
SDK initialized in 0 ms
Using incremental javac compilation for :libcocos2dx debug.
Using incremental javac compilation for :libcocos2dx debugUnitTest.
Using incremental javac compilation for :libcocos2dx release.
Using incremental javac compilation for :libcocos2dx releaseUnitTest.
Using incremental javac compilation for :libcocos2dx debugAndroidTest.
All projects evaluated.
Analytics other plugin to proto: Unknown plugin type com.android.build.gradle.FeaturePlugin expected enum COM_ANDROID_BUILD_GRADLE_FEATUREPLUGIN
Analytics other plugin to proto: Unknown plugin type com.android.build.gradle.InstantAppPlugin expected enum COM_ANDROID_BUILD_GRADLE_INSTANTAPPPLUGIN
Analytics other plugin to proto: Unknown plugin type com.android.build.gradle.LibraryPlugin expected enum COM_ANDROID_BUILD_GRADLE_LIBRARYPLUGIN
Selected primary task 'assembleRelease' from project :
file or directory '/Volumes/Data/Playground/MacOSTestBuild/build/jsb-default/frameworks/runtime-src/proj.android-studio/libs', not found
file or directory '/Volumes/Data/Playground/MacOSTestBuild/build/jsb-default/frameworks/runtime-src/proj.android-studio/game/libs', not found
file or directory '/Volumes/Data/Playground/MacOSTestBuild/build/jsb-default/frameworks/runtime-src/proj.android-studio/libs', not found
file or directory '/Volumes/Data/Playground/MacOSTestBuild/build/jsb-default/frameworks/runtime-src/proj.android-studio/game/libs', not found
file or directory '/Volumes/Data/Playground/MacOSTestBuild/build/jsb-default/frameworks/runtime-src/proj.android-studio/libs', not found
file or directory '/Volumes/Data/Playground/MacOSTestBuild/build/jsb-default/frameworks/runtime-src/proj.android-studio/game/libs', not found

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':libcocos2dx:compileReleaseJavaWithJavac'.
> Could not create service of type AnnotationProcessorDetector using JavaGradleScopeServices.createAnnotationProcessorDetector().

* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2m 31s
Error running command, return code: 1.

2 posts - 1 participant

Read full topic

Label Outline Bug

$
0
0

Version: Cocos Creator 2.4.0
Screen Shot 2020-08-10 at 6.43.38 PM

Label Outline creates a strange edge with some letters. Applies to system font and other ttf fonts

1 post - 1 participant

Read full topic

The ndk LongPath patch wsLongPaths-3.4 released

$
0
0

New project url:

Since v3.4, both cmake and ndk-build system(r14b~r21d) are supported on win7/win10

Note: Binaries files will upload at final github release page later
The v2.x is deprecated, all revisions of ndk, please use v3.4

1 post - 1 participant

Read full topic

How to restart scene

$
0
0

Hi friends
Is there any simple way to restart the scene? ( I have single scene game )
If not, what’s your suggestion about it?
Thanks guys

1 post - 1 participant

Read full topic


Cocos2dxJavascriptJavaBridge.evalString require issue

$
0
0

hi @pandamicro,
i am trying to use Cocos2dxJavascriptJavaBridge.evalString to pass data from java to my cocos creator js file. first of all does the js file have to be a component? in either case can you please tell me where in my cocos creator project or in my android studio project am i supposed to keep this js file.
also how am i supposed to refer to it in the require statement. i mean what will the file path be? please be specific. e.g. is this right ??? ->

var file = require(‘assets/Script/myScript’);

also, do i have to use the prototype keyword after the file variable or can i invoke a static method directly?
thanks in advance!!!

1 post - 1 participant

Read full topic

Edges not smooth

$
0
0

i use latest version of Cocos creator 2.4.2
i set the canvas size to 1080x1920
i have bad rendering results the edges no looks smooth as attached pictures
تعليق توضيحي 2020-08-11 174358
تعليق توضيحي 2020-08-11 174704
تعليق توضيحي 2020-08-11 174802
any tips to improve that

1 post - 1 participant

Read full topic

[ERROR] NOT update frame with cc.MeshRendered

$
0
0

Hi everyone,
I have a issue: i have a Node with it’s children is obj [cc.MeshRendered], i use tween to move the Node but obj [cc.MeshRendered] not move with node parent.
Do anyone have a solution for it? Help me!
I’m using Cocos Creator version 2.3.4

3 posts - 1 participant

Read full topic

5 Questions To Ask Before Building Your Game

How to add a click event without adding a script component to a button?

$
0
0

Hi, I have been trying to access a button in other node and add a click event to it.I have successfully reached the button component but cant able to add a click event to it can someone help me with this.

1 post - 1 participant

Read full topic

How to move 3d model with BoxCollider3D and SkeletonAnimation components

$
0
0

Hi all. I am trying to move the 3d character by changing its coordinates, for example, this.node.x + = 1 in the Update function. But its displayed image stays still on the viewport, even though the coordinates have changed. If the 3d model is the cubes created by default in CC(Box, Sphere…) then everything is fine.
Anyone can help? Thanks

1 post - 1 participant

Read full topic

Webview Android Doesn't display contents

$
0
0

So I make a webview and I get a lovely white screen with nothing on it and this in the error output

D/ViewRootImpl: ViewPostImeInputStage ACTION_DOWN
 W/linker: libwebviewchromium.so: unused DT entry: type 0x6ffffef5 arg 0x64b4
 W/linker: libwebviewchromium.so: unused DT entry: type 0x6ffffffe arg 0x6454
 W/linker: libwebviewchromium.so: unused DT entry: type 0x6fffffff arg 0x3
I/WebViewFactory: Loading com.google.android.webview version 83.0.4103.106 (code 410410650)
 I/cr_LibraryLoader: Loaded native library version number "83.0.4103.106"
 I/cr_CachingUmaRecorder: Flushed 3 samples from 3 histograms.
 D/SecWifiDisplayUtil: Metadata value : SecSettings2
D/ConnectivityManager: requestNetwork; CallingUid : 10126, CallingPid : 6806
 E/libEGL: validate_display:255 error 3008 (EGL_BAD_DISPLAY)
 E/chromium: [ERROR:gl_surface_egl.cc(549)] eglChooseConfig failed with error EGL_BAD_ATTRIBUTE
 W/cr_media: Requires BLUETOOTH permission
 E/chromium: [ERROR:gl_surface_egl.cc(549)] eglChooseConfig failed with error EGL_BAD_ATTRIBUTE
 W/System.err: mkdir failed: EEXIST (File exists) : /data/data/com.symbolicone.ouille/cache/WebView/Crash Reports
W/AudioCapabilities: Unsupported mime audio/mpeg-L1
W/AudioCapabilities: Unsupported mime audio/mpeg-L2
W/AudioCapabilities: Unsupported mime audio/x-ms-wma
W/AudioCapabilities: Unsupported mime audio/x-ima
W/VideoCapabilities: Unrecognized profile/level 32768/2 for video/mp4v-es
W/VideoCapabilities: Unrecognized profile/level 32768/2 for video/mp4v-es
W/VideoCapabilities: Unsupported mime video/wvc1
W/VideoCapabilities: Unsupported mime video/x-ms-wmv
W/VideoCapabilities: Unsupported mime video/x-ms-wmv7
W/VideoCapabilities: Unsupported mime video/x-ms-wmv8
W/VideoCapabilities: Unsupported mime video/mp43
I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es
I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es
W/VideoCapabilities: Unsupported mime video/sorenson
W/cr_MediaCodecUtil: HW encoder for video/avc is not available on this device.
D/ViewRootImpl: ViewPostImeInputStage ACTION_DOWN

to which I don’t see why It need Bluetooth as its text on an image on a screen, nor does it need any of the video types. It is true that the /data/data/com.symbolicone.ouille/cache/WebView/Crash Reports folder exists, and it is also empty.

The code I use to make it is

#if CC_TARGET_PLATFORM != CC_PLATFORM_WIN32
    auto webView = cocos2d::ui::WebView::create();
    webView->loadFile(m_htmlFile); 
    webView->setAnchorPoint(Point(0.0f,0.0f));
    webView->setPosition(Point(0.0f,0.0f));
    webView->setContentSize(Director::getInstance()->getVisibleSize());
    webView->setJavascriptInterfaceScheme("cocos2dx");
    webView->setOnJSCallback(CC_CALLBACK_2(BookCoverScene::callbackFromJS,this));
    this->addChild(webView);
#endif

the HTML file is part of the resources folder. The files worked fine on iOS Cocos 2d-x 2.x.
Any ideas?

1 post - 1 participant

Read full topic


sprite shadow effect

$
0
0

Hello!
I want to add shadow effect to sprite?, for round edge rectangle. like this images (image1, image2).
Image1:
oie_uG6jzLMoS0sJ
image2:
oie_AV1VAe1DeEe0

1 post - 1 participant

Read full topic

Help! Collision with PhysicBody when I use PhysicsEditor

$
0
0

In My Game, I shoot 1 bullet at 1 enemy. Each collision reduces the enemy’s blood by 1 blood.

tag1 = ObjA->getTag();
tag2 = ObjB->getTag();

if ((tag1 == tag_bullet)&&(tag2 == tag_enemy))
{
// reduce the enemy’s blood by 1 blood
}
if ((tag1 == tag_enemy)&&(tag2 == tag_bullet)
{
// reduce the enemy’s blood by 1 blood
}

When I use PhysicBody::createCircle or PhysicBody::createBox, the enemy will reduce 1 blood. But when I use PhysicsEditor, there will be a case where the enemy will reduce a lot of blood. Because at this time, PhysicBody is made up of many different PhysicBody.

Please, help me to solve this problem!

2 posts - 2 participants

Read full topic

How to receive output of a popup in a script?

$
0
0

Hi,
I have a functionality where scriptA opens a popup which has ScriptB with B1 and B2 functions for the two buttons in the popup I want to get the value which button was clicked in scriptA.

1 post - 1 participant

Read full topic

Help to understand new build files archtecture (CC 2.4>)

$
0
0

Well, with the changes with asset bundle in CC 2.4, looks like that the build assets also changed, and I need a little help to understand what it’s going on there. These concerns are using the Android build as example.

  1. The assets are no longer in the same path as they were in the project folder, I think that is to improve performance, but for some of us that uses Hot Update that is crucial, specially if you have multiple layers of hot updates and download them on-demand. Is there any way to come back?

  2. I can’t have a bundle inside the resources folder. Why?

  3. When the Asset Bundle documentation will be translated?

1 post - 1 participant

Read full topic

Tutorial: Cocos Creator: searchlight effects with shaders

$
0
0

Tutorial: Cocos Creator: searchlight effects with shaders

Introduction

The searchlight effect means that the entire scene or picture is black, and only the place illuminated by a light is bright. There are many ways to implement it but for this tutorial we use use a shader. The main reason to use a shader is to achieve higher efficiency, better effects, and increased scalability. Example:

Searchlight

Principles of Illumination

Developers know that the color in the program is determined by the three values of RGB. For example, the RGB value of red is (255, 0, 0), but the maximum value of the color in the GLSL language is 1.0, and it is usually represented by a vec4 data type. Red in GLSL is: vec4(1.0, 0.0, 0.0, 1.0);. The fourth parameter is the alpha value. In this example it is set to 1.

In reality, objects have all kinds of colors, not that they are the color themselves, but the color of the light it can reflect. Sunlight contains all colors of light. The color of light that an object can reflect is related to the particle characteristics of the object itself. This determines the wavelength range of light that it can reflect, while other ranges of light are absorbed. This results in see objects of various colors. Example:

Using this principle, we can use a shader to control the color display of the target to simulate lighting. For example, white light is set by using: vec4(1.0, 1.0, 1.0, 1.0). This vector is multiplied by the color in the fragment shader, because each value is 1, the color of the object does not change. When we set the red light to vec4 (1.0, 0.0, 0.0, 1.0), the object will be red.

We then control the range of light to be a circle, then it is called a searchlight effect.

Shader implementation

  • The following is the implementation process of a shader, not the complete code, only code snippets, developers who are familiar with the GLSL language should be able to understand, developers who do not understand can go to the end of the article to get the complete code and come back to learn.

  • The first is the light range logic, which judges whether it is within the light range based on the distance between the two points and the light center point. The points within the light range are the target color, and the points outside the range are set to black:

    Example when running:

  • A general lighting range effect is available, but it is not natural, there is no transition at the edge of the light, and there are jagged edges, let’s add the transition effect to the edge of the light through interpolation:

  • The smoothstep() function, in the above image, receives three parameters, the first is the minimum value of the range, the second is the maximum value of the range, and the third parameter is the target value x that needs to be calculated. If x is less than the minimum value, it returns 0, and if it is greater than the maximum value, it returns 1, and the rest return 0 to 1 interpolation. The range in the above code is the light radius and the radius plus 0.1 to perform interpolation to achieve the transition effect of the light edge. Look at it after the modification, the effect is already good. Example:

  • Finally, we can notice the movement of the light source by setting the light_center parameter through code:

Note:- if your scene or target picture is not a square, then the range of illumination may not be a perfect circle, but an ellipse. This is because the coordinate range in Open GL is from -1 to 1, but the width and height are not necessarily proportional. So when developers calculate the range of the circle, pass in the aspect ratio of the scene or picture, and then correct it when calculating the range of the circle:

Advanced Optimizations

Diffusing Ambient Light

  • Everyone knows that no matter how dark a room is, we can always vaguely see the outline of the object, which is caused by the diffusely reflected ambient light. The surface of the object is not smooth, but rather is uneven. It will always reflect the light of the light source in all directions. After receiving the reflected light, other objects will reflect again and repeat the cycle. This is diffuse reflection, which is also called ambient light. This is why we can see things in a room without a light source. The principle of diffuse reflection is as follows:

  • In our example, the place where the light does not shine is completely dark, and sometimes we also need some ambient light caused by diffuse reflection. The real diffuse reflection algorithm is very complicated. It needs to be calculated by the normal vector. Here we are just a 2D texture map, so we just set the ambient light to an average constant, and add the environment to the logic where the light is not illuminated. Optical logic:

    Can you see? The running effect is basically the same as the effect at the beginning of the tutorial.

Light intensity and light source color

  • In the previous process, we did not intervene in the target color within the illumination range, ensuring the inherent color of the target. However, sometimes we also need to change something. For example, the ambient light is mentioned above. The place with no light is not completely dark. Then, conversely, the place with light must be bright? Sometimes we also need to adjust the brightness and color of the light.

  • Look at the brightness of the light first. This is relatively simple. The logic is the same as the intensity of the ambient light. We then define a parameter of the light source intensity:

  • Multiply the lighting part and the transition part of the lighting edge involved in the interpolation operation by the light intensity to achieve our target effect. (However, one issue that needs to be noted here is what effect will the light intensity result be less than ambient_strength? You can try it out and try to modify it.)

  • Next, Add support for the color of the light source. According to the lighting principle mentioned at the beginning of the tutorial, developers can directly multiply the target color in our previous example by a light source color. For the light source color, developers should use the red light mentioned above:

Running result:

Conclusion

This tutorial was contributed by Ituuz. Thank you Ituuz!. Visit their personal blog to learn more and find more interesting tutorials.

You can download the complete code for this tutorial on GitHub.

1 post - 1 participant

Read full topic

Viewing all 17118 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>