MIR Engine
미래 지향 설계에 초점을 맞춘 자체 제작 게임 엔진
로딩중...
검색중...
일치하는것 없음
MIR::Sprite 구조체 참조final

렌더링 가능한 스프라이트 정보를 담는 컴포넌트 더 자세히 ...

#include <Sprite.hpp>

MIR::Sprite에 대한 상속 다이어그램 :
[범례]
MIR::Sprite에 대한 협력 다이어그램:
[범례]

Public 멤버 함수

 Sprite ()
 기본 생성자
 
 Sprite (std::shared_ptr< sf::Texture > texture)
 텍스처를 지정하는 생성자
 
 Sprite (std::shared_ptr< sf::Texture > texture, std::uint16_t width, std::uint16_t height)
 텍스처와 스프라이트 크기를 지정하는 생성자
 
- MIR::Component(으)로부터 상속된 Public 멤버 함수
virtual ~Component ()=default
 가상 소멸자
 

데이터 필드

std::shared_ptr< sf::Texture > texture
 스프라이트에 할당할 텍스처를 가리키는 shared_ptr
 
sf::Sprite sprite
 SFML의 스프라이트 객체
 
std::uint16_t width
 스프라이트의 폭(가로 길이)
 
std::uint16_t height
 스프라이트의 높이(세로 길이)
 

추가로 상속된 멤버들

- MIR::Component(으)로부터 상속된 Public 타입
using Tag = std::uint32_t
 컴포넌트를 식별하기 위한 태그 타입 정의
 

상세한 설명

렌더링 가능한 스프라이트 정보를 담는 컴포넌트

이 컴포넌트는 SFML의 텍스처(sf::Texture)와 스프라이트(sf::Sprite) 관리. 엔티티에 부착함으로써 그래픽 렌더링 가능. width, height 필드는 스프라이트의 가로, 세로 크기를 저장.

생성자 & 소멸자 문서화

◆ Sprite() [1/3]

MIR::Sprite::Sprite ( )
inline

기본 생성자

texture를 nullptr로, width와 height를 0으로 초기화. 텍스처가 설정되지 않은 상태로 시작하며, 이후 필요 시 setTexture를 호출하거나 다른 생성자를 통해 텍스처 지정 가능.

78 : texture(nullptr), sprite(), width(0), height(0)
79 {
80 }
std::uint16_t width
스프라이트의 폭(가로 길이)
Definition Sprite.hpp:62
std::uint16_t height
스프라이트의 높이(세로 길이)
Definition Sprite.hpp:69
sf::Sprite sprite
SFML의 스프라이트 객체
Definition Sprite.hpp:55
std::shared_ptr< sf::Texture > texture
스프라이트에 할당할 텍스처를 가리키는 shared_ptr
Definition Sprite.hpp:47

◆ Sprite() [2/3]

MIR::Sprite::Sprite ( std::shared_ptr< sf::Texture > texture)
inline

텍스처를 지정하는 생성자

매개변수
texture스프라이트에 적용할 텍스처의 shared_ptr

texture가 유효한 경우 sprite에 텍스처 설정. width, height는 0으로 초기화되며, 필요 시 이후에 설정 가능.

91 : texture(texture), sprite(), width(0), height(0)
92 {
93 if(texture)
94 sprite.setTexture(*texture);
95 }

◆ Sprite() [3/3]

MIR::Sprite::Sprite ( std::shared_ptr< sf::Texture > texture,
std::uint16_t width,
std::uint16_t height )
inline

텍스처와 스프라이트 크기를 지정하는 생성자

매개변수
texture스프라이트에 적용할 텍스처의 shared_ptr
width스프라이트의 가로 길이
height스프라이트의 세로 길이

texture가 유효한 경우 sprite에 텍스처를 설정하고, 지정한 width와 height를 통해 이후 렌더링 논리나 충돌 판정에 활용 가능.

109 {
110 if(texture)
111 sprite.setTexture(*texture);
112 }

필드 문서화

◆ height

std::uint16_t MIR::Sprite::height

스프라이트의 높이(세로 길이)

엔티티 그래픽의 실제 세로 길이.

◆ sprite

sf::Sprite MIR::Sprite::sprite

SFML의 스프라이트 객체

texture를 할당받은 후, sprite에 텍스처를 설정함으로써 실제 화면에 렌더링 가능한 그래픽 개체를 정의.

◆ texture

std::shared_ptr<sf::Texture> MIR::Sprite::texture

스프라이트에 할당할 텍스처를 가리키는 shared_ptr

std::shared_ptr를 사용하여 텍스처 리소스를 공유하고, 텍스처가 더 이상 필요하지 않을 때 자동으로 메모리 해제.

◆ width

std::uint16_t MIR::Sprite::width

스프라이트의 폭(가로 길이)

엔티티 그래픽의 실제 가로 길이.


이 구조체에 대한 문서화 페이지는 다음의 파일로부터 생성되었습니다.: