Buy me a coffee
본문 바로가기
728x90
SMALL

SFML7

[SFML / Code::Blocks] example Man (Player) Spritesheet Test example Man (플레이어) 스프라이트시트 테스트 SFML으로 example Man (플레이어) Spritesheet Test 게임 리소스 관리를 위해서 파일 분할 main.cpp (main loop, window, input 등등), player.cpp, player.h(.hpp) 파일 Packed Sprite를 Sprite 픽셀 사이즈에 맞춰 수정 필요 (SDL2 역시 똑같이 정리해야함) Character(const sf::Vector2f& pos) : pos(pos) { sprite.setTextureRect({0,0,152,152}); animations[int( AnimationIndex::WalkingUp )] = Animation(152,0,152,152); animations[int( AnimationIndex::WalkingDown )].. 2023. 3. 3.
[ChatGPT][SFML][2D 게임 개발] C++ 및 SFML 라이브러리를 사용하여 360도 회전하는 로고 회전 애니메이션을 만드는 방법의 예 C++ 및 SFML 라이브러리를 사용하여 360도 회전하는 로고 회전 애니메이션을 만드는 방법의 예 // Here's an example of how you can create a logo rotation animation that rotates 360 degrees using C++ and the SFML library #include int main() { // Create the main window sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window"); // Load a sprite to display sf::Texture texture; if (!texture.loadFromFile("logo.png")) return EXIT_FAIL.. 2023. 1. 13.
[SFML][Code::Blocks 코드블럭] How to Set up SFML SFML 설정방법 Code::Blocks 코드블럭(20.03 버전)에서 SFML(2..5.1버전 기준) 설정방법이다. How to Set up SFML SFML 설정방법 설정이 끝났다면 프로젝트 생성을 하고 예제 코드를 넣어서 컴파일은 해서 실행이 된다면 설정이 올바르게 된 것이다. ===================== *(주의) 실행을 하기위해서는 코드 수정이 좀 필요하다. 이미지 파일이 필요하며 이미지 파일명과 확장자명을 수정해야한다.) 예제 코드 #include #include int main() { // Create the main window sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window"); // Load a sprite to display sf.. 2022. 10. 15.
728x90
LIST