Cocos Creator2025. 5. 30. 17:47

# 폴드폰(세로 접는 폰) 의 경 앱실행시에 하단의 UI 가 유지 되면
실제 화면의 폭이 길어짐에 따라, view 부분이 90도 돌아간 화면으로
보이는 문제 발생

-체크 방법 : 수치를 비교해 보면 아래와 같다.

이 값을 받아서 수정 하려고 하지 말자! 고생만 한다.

-화면 UI 를 width에 맞추려고 screen.resolution 와 view.getVisibleSizeInPixel 를

조회 하여 변경하였으나. 실제 보여지는 width 와는 다른 비율이다.


window.innerWidth > window.innerHeight 
screen.resolution.width < screen.resolution.height
view.getVisibleSizeInPixel().width < view.getVisibleSizeInPixel().height

-해결 방법
buil의 세팅에서 Orientation 값을 Auto 로 설정 함!!!!!!!!!!

 

 

Posted by 차돌이라네
프로그램관련 기타2025. 2. 18. 16:12

* 머신러닝
-개와 고양이의 사진을 계속 보여주면 스스로 개와 고양이를 분류한다.

* 딥러닝
-개나 고양이의 특징들을 알려줘서 개와 고양이를 분류하도록 한다.

 

맞나? 맞을꺼야! 

Posted by 차돌이라네
Cocos Creator2024. 1. 17. 13:58

# 스파인 특정 slot 의 색상을 변경

 

let slot = this.box.findSlot("face");
let att = this.box.getAttachment("face", "smile");
var color = slot.color;
color.r = 1;
color.g = 0.984;
color.b = 0;
slot.setAttachment(att);

 

 
# RGB 0 ~ 1 로 찾기 사이트

https://rgbcolorpicker.com/0-1

Posted by 차돌이라네
프로그램관련 기타2023. 9. 8. 10:57

- 윈도우 명령 프롬프트를 열고, 해당 디렉토리로 이동

- dir /b *.파일 형식 ( 예 : dir /b *.json )

Posted by 차돌이라네
프로그램관련 기타2021. 4. 21. 10:32

 

Redis desktop manager 로 redis 에 저장 된 내용을 확인 해 보기 편한 방법이 있다.

현재는 유로 이지만, 무료 버전을 사용하여 AWS ElastiCache 에 연결하는 방법이다.

AWS ElastiCache 는 직접 연결이 안되게 되어 있으므로, 같은 AWS 상에 EC2 서버가 있다면

SSH 로 연결이 가능하다.

 

Address : ElastiCache 가 만약 cluster 모드일 경우에는 기본 앤드 마스터 주소를 입력

SSH Address : AWS 에 있는 EC2 서버의 아이피를 입력

Private Key : EC2 서버 연결시 사용하는 pem 파일 적용

 

 

Posted by 차돌이라네
프로그램관련 기타2020. 12. 5. 13:15

# node.js 에서 gc() 수행 방법

 

-소스코드에 추가

global.gc();

 

-node 실행

node --express_gc app.js

Posted by 차돌이라네
html52020. 11. 10. 11:06

# pixi 에서 spine 사용시 투명하게 하는 특정 필터를 사용 했을때 검정 박스 나오는 문제

 

var app = PIXI.autoDetectRenderer(800700, {backgroundColor: 0xFFFFFFtransparent: true});

 

pixi 생성시 transparent: true 옵션을 추가한다

 

Posted by 차돌이라네
html52020. 9. 29. 10:50

# JSON 파일로 여러 node 동시 실행 방법

 

(1) 서버에 PM2 설치 : npm install pm2

(2) json 파일 생성하기 : play.json

{

  "apps":

  [

    {

      "name""play_1",

      "script""js/play_1.js",

      "watch"false,

      "env": {

        "NODE_ENV""production",

        "API_PORT"7000

      },

      "autorestart"true,

      "restart_delay":2000,

      "node_args": ["--max_old_space_size=4096"]

    },

    {

      "name""play_2",

      "script""js/play_2.js",

      "watch"false,

      "env": {

        "NODE_ENV""production",

        "API_PORT"7000

      },

      "autorestart"true,

      "restart_delay":2000,

      "node_args": ["--max_old_space_size=4096"]

    }

]}

 

(3) 실행 : pm2 start play.json

 

# node 특정 시간 자동 재실행

 

  (1) 사용 방법 : 위의 json 파일 생성하여 일괄 실행 파일 에  "cron_restart""0 6 * * 1" 추가

    {

      "name""play_0",

      "script""js/play_0.js",

      "watch"false,

      "env": {

        "NODE_ENV""production",

        "API_PORT"5000

      },

      "cron_restart""0 6 * * 1",

      "autorestart"true,

      "restart_delay":2000,

      "node_args": ["--max_old_space_size=4096"]

    }

 

(2) 시간 설정

-  "cron_restart""0 6 * * 1", <=== 월요일 마다  6 시 0분에 재실행

- 값 순서 : 분(0~59) , 시간(0~23), 일(1~31), 월(1~12), 요일(0~7)

 

Posted by 차돌이라네
html52020. 7. 22. 10:34

# WebSocket 가능 브라우저 체크

 

if ('WebSocket' in window) { console.log("yes");}

 

 

Posted by 차돌이라네
Cocos Creator2020. 5. 13. 10:50

# 화면 캡쳐 해서 부치기

            var renderer = new cc.RenderTexture(cc.winSize.width,cc.winSize.heightcc.Texture2D.PIXEL_FORMAT_RGBA8888);

renderer.setAutoDraw(true);

renderer.x = 0;

renderer.y = 0;        

renderer.beginWithClear(25525525500 , 0);

this.visit();

renderer.end();

            

var screenSprite = new cc.Sprite(renderer.getSprite().texture);

screenSprite.setPosition((cc.winSize.width*0.5), (cc.winSize.height*0.5));

screenSprite.setFlippedY(true);            

this.addChild(screenSprite);

 

Posted by 차돌이라네