ドキュメント

View Categories

ScrollLayerComponent

2 min read

ScrollLayerComponentはScrollBgLayerComponentとScrollComponentを組み合わせたコンポーネントです。

scroll_layer_component.hpp

class ScrollLayerComponent : public Component
{
public:
	using SCROLL = ScrollComponent::SCROLL;
public:
	ScrollLayerComponent(
		MOD mod,
		unsigned int scroll_width,
		unsigned int scroll_height,
		bool scrollable_x,
		bool scrollable_y,
		unsigned int scroll_amount,
		unsigned char scroll_bg_layer_bg_color_R,
		unsigned char scroll_bg_layer_bg_color_G,
		unsigned char scroll_bg_layer_bg_color_B,
		unsigned char scroll_bg_layer_bg_color_A,
		FcComponent component
	);

	ScrollLayerComponent(
		MOD mod,
		unsigned int scroll_width,
		unsigned int scroll_height,
		bool scrollable_x,
		bool scrollable_y,
		unsigned int scroll_amount,
		int scroll_min_x,
		int scroll_max_x,
		int scroll_min_y,
		int scroll_max_y,
		unsigned char scroll_bg_layer_bg_color_R,
		unsigned char scroll_bg_layer_bg_color_G,
		unsigned char scroll_bg_layer_bg_color_B,
		unsigned char scroll_bg_layer_bg_color_A,
		FcComponent component
	);

	~ScrollLayerComponent() = default;

	ScrollLayerComponent(ScrollLayerComponent const&);
	ScrollLayerComponent& operator=(ScrollLayerComponent const&);

	SCROLL* get();

	void configure();

private:
	std::unique_ptr<ScrollComponent> scroll;
	std::unique_ptr<ScrollBgLayerComponent> scroll_bg_layer;
	FcComponent component;
};


scroll、scroll_bg_layerを指定します。scrollするコンポーネントを指定します。

scroll_layer_component.cpp

void ScrollLayerComponent::configure()
{
  attach(scroll_bg_layer.get());
  scroll_bg_layer->attach(scroll.get());
  scroll->attach(component());
}


ScrollComponentとScrollBgLayerComponentの使い方の参考になります。

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です