-
Notifications
You must be signed in to change notification settings - Fork 0
/
InfiniteScrollNode.h
53 lines (40 loc) · 1.74 KB
/
InfiniteScrollNode.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//
// InfiniteScrollNode.h
// InfiniteScrollNodeTest
//
// Created by Jason Marziani on 3/26/12
// Copyright (c) 2012 Little Wins LLC. All rights reserved.
//
// Made compatible with Cocos2d-x 2.x by Stefan Nguyen on 7/30/12 (as CCParallaxScrollNode).
// Made compatible with Axmol Engine 2.x by Daniel Alias on 23/12/09 (yy/mm/dd)
//
#ifndef InfiniteScrollNodeTest_InfiniteScrollNode_h
#define InfiniteScrollNodeTest_InfiniteScrollNode_h
#include "axmol.h"
#include <android/log.h>
#include "InfiniteScrollOffset.h"
#ifndef PTM_RATIO
#define PTM_RATIO 32
#endif
using namespace axmol;
class InfiniteScrollNode : public ax::Layer
{
public:
virtual bool init();
CREATE_FUNC(InfiniteScrollNode);
SpriteBatchNode batch;
Size _range;
ax::Vector<InfiniteScrollOffset *> _scrollOffsets;
void addChild(Sprite *node, int z, Point r, Point p, Point so);
void addChild(Sprite *node, int z, Point r, Point p, Point so, Point v);
void removeChild(Sprite *node, bool cleanup);
void updateWithVelocity(Point vel, float dt);
void updateWithYPosition(float y, float dt);
void addInfiniteScrollWithZ(int z, Point ratio, Point pos, Point dir, Sprite *firstObject, ...);
void addInfiniteScrollXWithZ(int z, Point ratio, Point pos, Sprite* firstObject, ...);
void addInfiniteScrollYWithZ(int z, Point ratio, Point pos, Sprite* firstObject, ...);
void addInfiniteScrollWithObjects(const ax::Vector<Sprite *>& objects, int z, Point ratio, Point pos, Point dir);
void addInfiniteScrollWithObjects(const ax::Vector<Sprite *>& objects, int z, Point ratio, Point pos, Point dir, Point relVel);
void addInfiniteScrollWithObjects(const ax::Vector<Sprite *>& objects, int z, Point ratio, Point pos, Point dir, Point relVel, Point padding);
};
#endif