Files
wagic/projects/mtg/include/InteractiveButton.h
techdragon.nguyen@gmail.com a2179017d4 Extended Scroll() and OnScroll() to also take in magnitude as one of its parameters. magnitude is currently used in the deck editor to figure out how many cards to rotate around per swipe as function of velocity and the number of cards displayed on the screen.
fixed a compiler warning in SimplePopup in the constructor declaration
===DECK Editor changes ===
Added two touch buttons , one for "Sell Card", the other to switch between Deck and Collection.
changed swipe Left/Right to rotate card collection; removing the previous action which was to swap between deck/collection viewing

Note: GameStateDeckViewer isn't a JGuiController so can't leverage off the mButtons vector.  Thus, the buttons have to be handled by this class separately. (setButtonState, userPressedButton)
2012-01-26 13:53:03 +00:00

46 lines
1.1 KiB
C++

//
// InteractiveButton.h
//
// Created by Michael Nguyen on 1/23/12.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#ifndef wagic_InteractiveButton_h
#define wagic_InteractiveButton_h
#include <string>
#include <JLBFont.h>
#include <JGui.h>
#include "WResource_Fwd.h"
#include "SimpleButton.h"
using std::string;
#define SCALE_SELECTED 1.2f
#define SCALE_NORMAL 1.0f
const int kDismissButtonId = 10000;
const int kToggleDeckActionId = 10001;
const int kSellCardActionId = 10002;
class InteractiveButton: public SimpleButton
{
private:
JQuadPtr buttonImage;
JButton mActionKey;
public:
InteractiveButton(JGuiController* _parent, int id, int fontId, string text, float x, float y, JButton actionKey, bool hasFocus = false, bool autoTranslate = false);
virtual void Entering();
virtual bool ButtonPressed();
virtual void setImage( const JQuadPtr imagePtr, float xOffset = 0, float yOffset = 0);
virtual void checkUserClick();
//virtual void Update(float dt);
virtual void Render();
virtual ostream& toString(ostream& out) const;
};
#endif