示例#1
0
from direct.actor.Actor import Actor
from direct.gui.OnscreenText import OnscreenText
from direct.showbase.ShowBase import ShowBase
from panda3d import core
from panda3d.core import Point2, Point3, Mat4, Filename, LineSegs, \
    ClockObject, TextNode

from src.shared import config
from src.shared import messages
from src.shared.logconfig import newLogger
from src.shared.message_infrastructure import deserializeMessage, \
    badIMessageCommand
from src.shared.utils import minmax, thisShouldNeverHappen, thisIsNotHandled
from src.client import messages as cmessages

log = newLogger(__name__)


# TODO[#34]: Read from a config file.
DESIRED_FPS = 60

# Fraction of the window (on each axis) taken up by the "edge scrolling"
# region. Note that half of the region is on each side.
EDGE_SCROLL_WIDTH = 0.2


class WartsApp(ShowBase):
    """
    The application running all the graphics.
    """
示例#2
0
from direct.actor.Actor import Actor
from direct.gui.OnscreenText import OnscreenText
from direct.showbase.ShowBase import ShowBase
from panda3d import core
from panda3d.core import Point2, Point3, Mat4, Filename, LineSegs, \
    ClockObject, TextNode

from src.shared import config
from src.shared import messages
from src.shared.logconfig import newLogger
from src.shared.message_infrastructure import deserializeMessage, \
    badIMessageCommand
from src.shared.utils import minmax, thisShouldNeverHappen, thisIsNotHandled
from src.client import messages as cmessages

log = newLogger(__name__)

# TODO[#34]: Read from a config file.
DESIRED_FPS = 60

# Fraction of the window (on each axis) taken up by the "edge scrolling"
# region. Note that half of the region is on each side.
EDGE_SCROLL_WIDTH = 0.2


class WartsApp(ShowBase):
    """
    The application running all the graphics.
    """
    def __init__(self, graphicsInterface):
        ShowBase.__init__(self)