ドキュメント

View Categories

Click[IN]Component

< 1 min read

Click[IN]Componentはコンポーネントのクリックイベントを実行するコンポーネントです。以下のコンポーネントが標準で用意してあります。

  • ClickItemComponent


click_item_component.hpp

class ClickItemComponent : public Component
{
public:
  ClickItemComponent
  (
    MOD mod,
    std::function<void()> click_event,
    FcComponent component
  );

  ~ClickItemComponent() = default;

  ClickItemComponent(ClickItemComponent const&);
  ClickItemComponent& operator=(ClickItemComponent const&);

  void recapture();

  void configure();

private:
  std::unique_ptr<ClickComponent> click;
  FcComponent component;
};


クリック時のイベントとクリック対象のコンポーネントを指定します。引数としたコンポーネントの所有権はClickItemComponentになりますので、他のコンポーネントでattachしないように注意してください。

コメントを残す

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