Fission FSN
Loading...
Searching...
No Matches
gfCParkLensComponent.h
Go to the documentation of this file.
1/********************************************************************
2*
3* File: gfCParkLensComponent.h
4*
5* Purpose: Pan/zoom lens over the park's tile-map view (Phase 1).
6* Drives the fsCView entity's scale (zoom) and position
7* (pan) from drag/pinch gestures - the whole park, being
8* children of the view, comes along. Sits on its own
9* full-canvas hit-test entity so it catches gestures across
10* the screen; its target is the view, not itself.
11*
12* Phase 2 (deferred): reconciling gesture taps with the
13* existing tap-to-deploy components, and a desktop
14* mouse-wheel zoom.
15*
16*********************************************************************/
17
18#ifndef gfCParkLensComponenthdr
19#define gfCParkLensComponenthdr
20
22#include <fsCore/fsPoint.h>
23
25
26class fsCEntity;
27
28
30{
31 friend class fsCComponentFactory;
32
33public:
34
35 static const fsCUniqueId mTypeId;
36
37 // Sets the zoom range and scroll bounds. pViewportSize is the on-screen
38 // canvas; pContentSize is the map's on-screen size at min zoom (map pixels x
39 // the view's fill-to-width scale). Both axes pan; starts fit-to-width and
40 // centred. See fsCDrag::scrollRangeCalculate for how the two sizes bound the
41 // pan range.
42 void configure(const fsPoint& pViewportSize, const fsPoint& pContentSize,
43 fsF32 pMinZoom, fsF32 pMaxZoom);
44
45 virtual ~gfCParkLensComponent();
46
47protected:
48
49 // The single park view is the pan/zoom target (it is not an fsISubScene, so
50 // the base's subscene-search default won't find it).
51 fsCEntity* const targetGetDo() override;
52
53 // Phase 1: the park is always pannable/zoomable while the level is up.
54 fsBool acceptingInputGet() const override { return true; }
55
56 static fsIComponent* create(fsCEntity* pParent);
57
58 gfCParkLensComponent(fsCEntity* pParent, fsBool pHandleTaps, fsBool pHandleDragEvent,
59 fsBool pHandlePinchEvents);
60};
61
62#endif
Definition fsCEntity.h:39
Definition fsCUniqueId.h:21
Definition fsIComponent.h:26
fsCEntity *const targetGetDo() override
Definition gfCParkLensComponent.cpp:24
void configure(const fsPoint &pViewportSize, const fsPoint &pContentSize, fsF32 pMinZoom, fsF32 pMaxZoom)
Definition gfCParkLensComponent.cpp:10
friend class fsCComponentFactory
Definition gfCParkLensComponent.h:31
gfCParkLensComponent(fsCEntity *pParent, fsBool pHandleTaps, fsBool pHandleDragEvent, fsBool pHandlePinchEvents)
Definition gfCParkLensComponent.cpp:40
virtual ~gfCParkLensComponent()
Definition gfCParkLensComponent.cpp:46
static const fsCUniqueId mTypeId
Definition gfCParkLensComponent.h:35
fsBool acceptingInputGet() const override
Definition gfCParkLensComponent.h:54
static fsIComponent * create(fsCEntity *pParent)
Definition gfCParkLensComponent.cpp:32
gfILensComponent(fsCEntity *pParent, fsBool pHandleTaps, fsBool pHandleDragEvent, fsBool pHandlePinchEvents)
Definition gfILensComponent.cpp:300
bool fsBool
Definition fsBaseTypes.h:26
float fsF32
Definition fsBaseTypes.h:28
Definition fsPoint.h:17