Exemplo n.º 1
0
from OpenSR.Engine import ScriptWidget, ActionListener, Engine, ResourceManager, \
                          SoundManager, RadioButton, RadioButtonGroup, Action
from OpenSR.World import WorldManager

from OpenSR.test.Poly import PolyTestWidget

engine = Engine.instance()
resources = ResourceManager.instance()
sound = SoundManager.instance()
world = WorldManager.instance()

class TestingWidget(ScriptWidget, ActionListener):  
    TESTS = ['None', 'Polyline']
    
    def __init__(self):
        ScriptWidget.__init__(self)
        ActionListener.__init__(self)
        
        self.widget = None
        self.testBtnGroup = RadioButtonGroup()
        self.testBtns = []
        self.layer = 100
        self.addWidget(self.testBtnGroup)
        i = 0
        
        for test in self.TESTS:
            b = RadioButton(engine.defaultSkin.radioButtonStyle, test)
            b.position = (10, 50 + i * (b.height + 5))
            self.testBtnGroup.addRadioButton(b)
            self.testBtns.append(b)
            b.addListener(self)
Exemplo n.º 2
0
from OpenSR.World import WorldManager, DefaultWorldGen, SystemWidget
from OpenSR.Engine import Engine, ResourceManager, SoundManager, ScriptWidget, ActionListener, \
                          Sprite, GAISprite, SpriteXOrigin, SpriteYOrigin, WidgetNode, Button, \
                          Action, Label, LabelWidget, ColorLabel

from OpenSR.ORC.QuestWidget import QuestWidget
from OpenSR.ORC.QuestSelectionWidget import QuestSelectionWidget

import OpenSR.ORC.Settings
from OpenSR.ORC.WorldGen import WorldGen
import sys
import math

engine = Engine.instance()
resources = ResourceManager.instance()
sound = SoundManager.instance()
world = WorldManager.instance()


class StartMenuWidget(ScriptWidget, ActionListener):
    BG_SPEED = 20.0 / 1000.0
    BUTTON_FILES = {
        'newGame': '2ButNew',
        'loadGame': '2ButLoad',
        'settings': '2ButSettings',
        'records': '2ButRecords',
        'about': '2ButAbout',
        'exit': '2ButExit'
    }
    BUTTONS = ['newGame', 'loadGame', 'settings', 'records', 'about', 'exit']
    BUTTON_SPARSE = 60