Mana
Loading...
Searching...
No Matches
ambientlayer.h
Go to the documentation of this file.
1/*
2 * The Mana Client
3 * Copyright (C) 2009-2012 The Mana Developers
4 *
5 * This file is part of The Mana Client.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#pragma once
22
23#include "resource.h"
24
25class Graphics;
26class Image;
27
29{
30 public:
36 AmbientLayer(Image *img);
38
39 void update(int timePassed, float dx, float dy);
40
41 void draw(Graphics *graphics);
42
43 float mParallax = 0;
44 float mSpeedX = 0;
45 float mSpeedY = 0;
46 int mMask = 1;
47 bool mKeepRatio = false;
49 private:
51 float mPosX = 0;
52 float mPosY = 0;
53};
float mPosY
Current layer Y position.
void draw(Graphics *graphics)
float mPosX
Current layer X position.
float mSpeedX
Scrolling speed in X direction.
float mSpeedY
Scrolling speed in Y direction.
bool mKeepRatio
Keep overlay ratio on every resolution like in 800x600.
float mParallax
Scroll factor based on camera position.
ResourceRef< Image > mImage
void update(int timePassed, float dx, float dy)
A central point of control for graphics.
Definition graphics.h:78
Defines a class for loading and storing images.
Definition image.h:45
Automatically counting Resource reference.
Definition resource.h:74
Graphics * graphics
Definition client.cpp:104