Compare commits
144 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 142fa33548 | |||
| 4b6e871ac6 | |||
| 1fbbad053a | |||
| 61aa933d97 | |||
| 70c3ea773e | |||
| a16de04682 | |||
| 0280a12589 | |||
| 4dc8fef9c1 | |||
| 2c02645ec7 | |||
| 40bad327fe | |||
| f5653d3c4d | |||
| 4026d7818b | |||
| a0fda2f058 | |||
| 93546e2d5c | |||
| 85a562713a | |||
| 4e9beb1a5d | |||
| 522333e0f5 | |||
| b4c4d0264c | |||
| 21c3187fa3 | |||
| b377cfcdef | |||
| 5d384e531d | |||
| 2b00c64973 | |||
| 7c777dea22 | |||
| 9d0c77917d | |||
| 6d40ced435 | |||
| 0675ee7f79 | |||
| 0aec15a848 | |||
| 2ff01a99ac | |||
| 0596ed7739 | |||
| d8beb99964 | |||
| 648dfd8d75 | |||
| 279a7a3fc8 | |||
| a62aede62f | |||
| b07bbbc1c9 | |||
| 547ce87eaa | |||
| c206456d00 | |||
| 590dd13f8f | |||
| afd0e70479 | |||
| b9166b35b3 | |||
| 333fa51862 | |||
| ec6d256707 | |||
| 86764d92a6 | |||
| cf1c9b3e5e | |||
| b15d7179b6 | |||
| 72312f1249 | |||
| 373198f628 | |||
| e96d8c774b | |||
| 8e221e183d | |||
| 2249c49303 | |||
| 388362d318 | |||
| a554ea8e8b | |||
| 090719deee | |||
| e29a162a85 | |||
| e17fa9edc2 | |||
| e57529257e | |||
| 866f9228ef | |||
| 3a38a8b89b | |||
| 0509a23881 | |||
| cbb0741ab9 | |||
| 716bb0fac1 | |||
| acb193bd7b | |||
| 0a09beb731 | |||
| 93dca3df73 | |||
| 008143a3da | |||
| 30a4db432e | |||
| 65546baf01 | |||
| 8be5069490 | |||
| 802410644b | |||
| e74b172372 | |||
| 23ac59588e | |||
| 7f6e9de5e5 | |||
| 143906ae9d | |||
| b003371456 | |||
| 1e6fa37a10 | |||
| 935786a161 | |||
| 23c4d07432 | |||
| 77107ef1eb | |||
| cac4238b12 | |||
| 8c402c2dc3 | |||
| 9bff95826a | |||
| fc0f7cecc4 | |||
| 0b5c5ce17e | |||
| 9aa61532ff | |||
| 3271557f8a | |||
| 9587342129 | |||
| 9b4821308d | |||
| 663978906a | |||
| 60f3308b8b | |||
| a305d6e725 | |||
| 1feff344b8 | |||
| 4fa4ffae54 | |||
| 4ecd72de6e | |||
| 3ec495c3fc | |||
| 5efc437384 | |||
| a777f4d3b1 | |||
| ff139808ff | |||
| 07136f9be8 | |||
| 35fc2295e9 | |||
| 2b262ccca3 | |||
| d42aab3dff | |||
| 612c347498 | |||
| 3c4540131a | |||
| 43317f6e02 | |||
| 523742d8de | |||
| 9516ee910e | |||
| 3ea31a3862 | |||
| 649411a4ef | |||
| a0e60e5453 | |||
| e3f1f40a78 | |||
| d0177f4c52 | |||
| 84a3a55a03 | |||
| 048075b47a | |||
| fab097c92a | |||
| 9d26bd8c04 | |||
| 664d243c23 | |||
| 9a0906655d | |||
| 13d60f2741 | |||
| 7d4de64d0b | |||
| 9ada2d9884 | |||
| a5f1951cfb | |||
| 98850e4c5c | |||
| 709e1f925d | |||
| b11ae331a5 | |||
| 3ba4b26b99 | |||
| b864077017 | |||
| d411dff1c0 | |||
| 7fc7453450 | |||
| 1799971885 | |||
| b999911292 | |||
| 29e0f9ad21 | |||
| d821b7eb8b | |||
| 272a214304 | |||
| 7f15b351ee | |||
| 5a6a12a14a | |||
| 01493c7063 | |||
| 244055fcb7 | |||
| 0415af5f31 | |||
| f73372c924 | |||
| 65cdc24e37 | |||
| 1b2d439651 | |||
| b383942c69 | |||
| 73bd109abb | |||
| 33ffd5dedb | |||
| 7422fe43b8 |
@@ -28,3 +28,29 @@ launchertrans.rpy
|
||||
jcc
|
||||
scite/scite.zip
|
||||
screenshot*
|
||||
.ropeproject
|
||||
release_cardgame.sh
|
||||
cardgame
|
||||
dse.split
|
||||
empty
|
||||
empty-linux-x86.tar.bz2
|
||||
empty-mac.zip
|
||||
empty.zip
|
||||
errors.txt
|
||||
icons
|
||||
iliad-icon.png
|
||||
iliad-work
|
||||
kuroi
|
||||
lsprofcalltree.py
|
||||
manifest.xml
|
||||
mediatest
|
||||
musicroom
|
||||
nobmtest
|
||||
renpy-iliad.sh
|
||||
renpy.kcg
|
||||
renpy.stats
|
||||
renpygame-1.2.zip
|
||||
speedtest
|
||||
styles.txt
|
||||
renpygame-demo/game/saves
|
||||
./lib
|
||||
|
||||
@@ -1,3 +1,314 @@
|
||||
New in Ren'Py 6.9.1
|
||||
-------------------
|
||||
|
||||
The music and video playback code has been completely rewritten. The
|
||||
new implementation uses the ffmpeg library. It includes the following
|
||||
features:
|
||||
|
||||
* Support for ogg, mp3, mp2, wav, and flac audio.
|
||||
|
||||
* Support for theora, mpeg4 part 2 (including DivX and Xvid), mpeg2,
|
||||
and mpeg1 video.
|
||||
|
||||
* Support for an arbitrary number of named channels, replacing the
|
||||
previous eight numbered channels.
|
||||
|
||||
* Audio files are now automatically converted to the output sampling
|
||||
rate (by default, 44100hz). This prevents the problems that would
|
||||
previously crop up when playing audio sampled at other rates.
|
||||
|
||||
* The play, queue, and stop statements now take a channel name as the
|
||||
second argument, which makes using user-defined channels easier.
|
||||
|
||||
As part of this rewrite, we have eliminated support for mod formats,
|
||||
as they are not supported by ffmpeg.
|
||||
|
||||
Please read the reference manual documentation for Audio and Movies to
|
||||
learn the new interface.
|
||||
|
||||
The new code requires some changes in the saved data. As a result,
|
||||
loading a file saved with a prior version of Ren'Py may lead to a lack
|
||||
of music until the next track is played.
|
||||
|
||||
|
||||
|
||||
The new window statement allows one to control if an empty window is
|
||||
shown when no character is speaking. Specifically, the
|
||||
|
||||
window show [transition]
|
||||
|
||||
statement shows the window, and the
|
||||
|
||||
window hide [transition]
|
||||
|
||||
statement hides it. Both can take an optional
|
||||
transition. config.empty_window is responsible for displaying the
|
||||
window, while config.window_show_transition and
|
||||
config.window_hide_transition are default transitions. The state of
|
||||
the window can be determined by testing _window. The
|
||||
renpy.shown_window function can be called to suppress displaying the
|
||||
empty window, and is called automatically when characters speak.
|
||||
|
||||
|
||||
Hotspots for the game menu buttons can be defined as part of
|
||||
layout.imagemap_load_save, layout.imagemap_preferences, and
|
||||
layout.imagemap_yesno_prompt. Doing so prevents layout.navigation from
|
||||
being called for that screen. It also allows opaque imagemaps to be
|
||||
used, rather than forcing them to be transparent to allow the
|
||||
navigation to show through.
|
||||
|
||||
|
||||
There is a new config.windows_icon variable, that lets one set the
|
||||
window icon for Windows separately from Mac OS X and Linux.
|
||||
|
||||
|
||||
Ren'Py now automatically scales itself down when it detects that the
|
||||
game window is too large for the screen.
|
||||
|
||||
|
||||
The define.move_transitions function can now pass keyword arguments to
|
||||
the moves it creates. The most useful thing with this is to pass
|
||||
subpixel=True, in order to create subpixel move transitions.
|
||||
|
||||
|
||||
The Motion (including Move and Pan), Zoom, RotoZoom, and FactorZoom
|
||||
displayables now use the style.motion style, which now has xanchor and
|
||||
yanchor both set to 0. This gives these movements the same semantics
|
||||
when used inside an image clause as they have outside one.
|
||||
|
||||
|
||||
im.Grayscale and im.Sepia now take properties, so they can be
|
||||
positioned.
|
||||
|
||||
|
||||
The new renpy.get_placement function returns information about the
|
||||
placement of displayables.
|
||||
|
||||
|
||||
Improved the render management code, so there should no longer be any
|
||||
leaks reported during shutdown.
|
||||
|
||||
|
||||
Deal with the case where a bmfont has a negative offset for the first
|
||||
character in a string.
|
||||
|
||||
|
||||
Added more verbose diagnostics when illegal statements are run in the
|
||||
init phase.
|
||||
|
||||
|
||||
Added _rollback, which controls if rollback is enabled.
|
||||
|
||||
|
||||
Added a target parameter to renpy.full_restart, which allows the main
|
||||
menu screen to be selected after a restart.
|
||||
|
||||
|
||||
|
||||
Fixed a bug that caused layout.imagemap_main_menu to call a label even
|
||||
though there was a button with the same name.
|
||||
|
||||
Fixed a bug that prevented Zoom from working in non-bilinear mode.
|
||||
|
||||
Fixed a bug that could cause buttons not not consume events when using
|
||||
an imagemap main menu.
|
||||
|
||||
Fixed a bug that caused Transform to produce an incorrectly-sized
|
||||
render.
|
||||
|
||||
Fixed a bug that could cause crashing when rolling back to a Zoom with
|
||||
an after_child.
|
||||
|
||||
Fixed a bug that could cause segfaults when saving overly-complicated
|
||||
images.
|
||||
|
||||
|
||||
New in Ren'Py 6.9.0
|
||||
-------------------
|
||||
|
||||
This release features a rewritten rendering system. The rendering
|
||||
subsystem is what manages drawing to the screen. There have been
|
||||
several major improvements:
|
||||
|
||||
* The render system has been simplified. Although still complex, it's
|
||||
now easier to understand than the old system, while also being
|
||||
naturally a bit faster.
|
||||
|
||||
* That being said, the render system now focuses more on framerate
|
||||
consistency than raw speed.
|
||||
|
||||
* The render system now supports subpixel drawing, drawing images at
|
||||
locations that are not integer pixel boundaries. This is enabled by
|
||||
setting the subpixel style property to True for a displayable. (It
|
||||
makes the most sense to do this for Move and Pan, and less sense to
|
||||
do this for non-moving displayables.)
|
||||
|
||||
* The render system supports specifying subpixel placement of
|
||||
displayables. This is done using the new absolute type. (A
|
||||
floating-point position is still interpreted as a fraction of the
|
||||
area in which the displayable is placed.)
|
||||
|
||||
* The render system supports a rotate-zoom-alpha mode, in which allows
|
||||
a displayable to be rotated, zoomed, and have its alpha
|
||||
changed. When this mode is used, the cost remains constant, even
|
||||
when multiple transformations are composed. Currently, this is only
|
||||
used by Transform and ui.transform.
|
||||
|
||||
* The render system supports rotating and scaling focusable objects.
|
||||
|
||||
Improved the transform routine used by RotoZoom and Transform. It's
|
||||
now both more accurate and faster. On Intel computers, it is now
|
||||
accelerated using MMX instructions.
|
||||
|
||||
|
||||
The image statement now implicitly places itself inside an init block
|
||||
if it's not inside an init block to begin with. The code:
|
||||
|
||||
image bg world = "world.jpg"
|
||||
|
||||
is now equivalent to:
|
||||
|
||||
init 990:
|
||||
image bg world = "world.jpg"
|
||||
|
||||
|
||||
When compiling python blocks containing strings with a unicode
|
||||
character in them, Ren'Py will automatically prepend a u to any string
|
||||
that's missing it. This should make life easier for users of non-ASCII
|
||||
languages.
|
||||
|
||||
|
||||
The new ui.autobar function makes it easy to make a bar that
|
||||
varies between two values over time.
|
||||
|
||||
|
||||
The new renpy.Container class can be subclassed to create a user-defined
|
||||
displayable thatr contains other displayables, like Transforms.
|
||||
|
||||
|
||||
The new im.FactorScale image manipulator allows images to be scaled by
|
||||
a specified factor at preload time. This is generally faster than doing the
|
||||
equivalent scaling at display time with FactorZoom.
|
||||
|
||||
|
||||
The new renpy.sound.set_pan function allows sound and music to be
|
||||
smoothly panned over time.
|
||||
|
||||
|
||||
The new config.label_callback variable allows a function to be called
|
||||
whenever control reaches a label. It can distinguish between jumps to
|
||||
that label and control falling through.
|
||||
|
||||
|
||||
There have been a couple of places where properly documented functions
|
||||
have superseded semi-documented calls into the Ren'Py internals:
|
||||
|
||||
The renpy.game_menu and ui.gamemenus functions are now the preferred ways
|
||||
of getting access to the game menu.
|
||||
|
||||
The ui.jumps function now takes a transition argument, allowing it to subsume
|
||||
the undocumented _intra_jumps.
|
||||
|
||||
|
||||
Ren'Py now looks for the file environment.txt in the directory
|
||||
containing Ren'Py itself. If it finds it, it loads the file as a
|
||||
python file, and uses it to set the default values of environment
|
||||
variables. This allows things like the editor or the scale factor to
|
||||
be set even on platforms that don't make it easy to change environment
|
||||
variables globally.
|
||||
|
||||
|
||||
The reporting of parse errors involving missing quotes has been
|
||||
improved.
|
||||
|
||||
|
||||
Changed the behavior of overlays during transitions. Now, both the old
|
||||
and new screens will use the new overlay. Previously, the overlay was
|
||||
cleared out during a transition, which didn't work well, as (for
|
||||
example) a dissolve would cause the overlay to blink out and then
|
||||
dissolve back in again.
|
||||
|
||||
|
||||
MoveTransition and define.move_transitions have been changed to take
|
||||
a layers argument, giving the list of layers the transition applies
|
||||
to. By default, this is only the master layer, which is a change in
|
||||
their behavior.
|
||||
|
||||
|
||||
Calling theme.roundrect() no longer implies layout.button_menu().
|
||||
|
||||
|
||||
Ren'Py now autosaves when entering the quit prompt, and will not actually
|
||||
quit until this autosave is complete.
|
||||
|
||||
|
||||
The default framerate limit (config.framerate) has been raised to
|
||||
100fps. This make tearing less noticable than on a 60hz screen.
|
||||
|
||||
|
||||
Added renpy.partial as a version of renpy.curry that requires two
|
||||
function calls, rather than three.
|
||||
|
||||
|
||||
Fixed a divide by zero error that occured when Alpha was used for 0
|
||||
seconds.
|
||||
|
||||
|
||||
Libvorbis has been upgraded to version 1.2.0.
|
||||
|
||||
|
||||
To reduce distribution size, OGG Speex support was dropped.
|
||||
|
||||
|
||||
New in Ren'Py 6.8.1
|
||||
-------------------
|
||||
|
||||
Added support for the iRex iLiad ebook reader platform. This required
|
||||
adding the following features, which may prove useful for other
|
||||
platforms:
|
||||
|
||||
Added support for the RENPY_SCALE_WIDTH environment variable, which
|
||||
allows the game to be scaled to a specific width, if it's larger.
|
||||
|
||||
Added support for the RENPY_LESS_MEMORY environment variable, which
|
||||
reduces the amount of memory used by Ren'Py in exchanged for reduced
|
||||
speed.
|
||||
|
||||
Added support for the RENPY_LESS_UPDATES environment variable, which
|
||||
tries to reduce the number of screen updates to one per interaction.
|
||||
|
||||
Added support for the RENPY_LESS_MOUSE environment variable, which
|
||||
prevents the mouse from being shown.
|
||||
|
||||
The iLiad support was sponsored by Hixbooks.
|
||||
|
||||
|
||||
It is now possible to rebuild the distribution of a game by unzipping
|
||||
it underneath the Ren'Py directory, selecting it as a project, and
|
||||
building the distributions. This makes it easy to upgrade the version
|
||||
of Ren'Py used by a game, or to build a version of it that works on
|
||||
your favorite platform.
|
||||
|
||||
|
||||
The new Alpha function can be used to change the alpha level of a
|
||||
displayable. (im.Alpha can only be used with other image
|
||||
manipulators.)
|
||||
|
||||
|
||||
User-defined statements are now documented in the reference manual,
|
||||
making them officially supported.
|
||||
|
||||
A user-defined statement can now be used as the default
|
||||
statement. This allows you to replace the say statement with an
|
||||
alternate of your own devising.
|
||||
|
||||
|
||||
Fixed a bug that occured when space characters were inserted
|
||||
immediately after a newline.
|
||||
|
||||
Fixed a problem displaying a presplash image on the mac platform.
|
||||
|
||||
|
||||
New in Ren'Py 6.8.0
|
||||
-------------------
|
||||
|
||||
@@ -4088,4 +4399,3 @@ controls which transitions are performed.
|
||||
|
||||
Added a Pan function which can be used in an at clause. This allows us
|
||||
to pan over a background image.
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Copyright 2004-2007 PyTom <pytom@bishoujo.us>
|
||||
Ren'Py itself is covered by the terms of the following (MIT) license:
|
||||
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation files
|
||||
@@ -19,9 +20,6 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
---
|
||||
|
||||
(The above is the MIT License)
|
||||
|
||||
Please see each individual source file for a list of copyright
|
||||
holders. The pictures of Eileen in the demo are Copyright 2006
|
||||
@@ -34,25 +32,20 @@ launchers may contain code taken from the following projects:
|
||||
* Pygame (LGPL)
|
||||
* SDL (LGPL)
|
||||
* SDL_image (LGPL)
|
||||
* SDL_sound (LGPL)
|
||||
* SDL_ttf (LGPL)
|
||||
* SDL_mixer (LGPL)
|
||||
* Freetype (LGPL)
|
||||
* FFmpeg (LGPL)
|
||||
* jpeg (JPEG License)
|
||||
* libmodplug (Public Domain)
|
||||
* libogg (Xiph.org License)
|
||||
* libpng (PNG license)
|
||||
* libvorbis (Xiph.org License)
|
||||
* smpeg (LGPL)
|
||||
* speex (Xiph.org License)
|
||||
* zlib (Zlib License)
|
||||
* zlib (Zlib License)
|
||||
* bzip2 (Bzip2 License)
|
||||
* pyobjc (MIT License)
|
||||
|
||||
The Linux launcher may also include code from:
|
||||
The Linux build may also include code from:
|
||||
|
||||
* directfb (LGPL)
|
||||
* svgalib (LGPL)
|
||||
* svgalib (LGPL)
|
||||
|
||||
For the purpose of LGPL compliance, the source code to all LGPL
|
||||
software we depend on is either in the Ren'Py package (available from
|
||||
@@ -61,9 +54,13 @@ http://www.renpy.org/), or in the renpy-deps package
|
||||
by including a copy of this license with every copy of Ren'Py you
|
||||
distribute, and referring to it in your project's README file.
|
||||
|
||||
The default Ren'Py build distributes Ren'Py alongside jEdit, which is
|
||||
licensed under the GNU GPL. The source code to jEdit is distributed as
|
||||
part of the renpy-deps package (http://www.renpy.org/dl/lgpl/).
|
||||
|
||||
|
||||
GNU Lesser General Public License
|
||||
---------------------------------
|
||||
=================================
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
@@ -575,7 +572,7 @@ That's all there is to it!
|
||||
|
||||
|
||||
Python License
|
||||
--------------
|
||||
==============
|
||||
|
||||
1. This LICENSE AGREEMENT is between the Python Software Foundation
|
||||
("PSF"), and the Individual or Organization ("Licensee") accessing and
|
||||
@@ -625,7 +622,7 @@ Agreement.
|
||||
|
||||
|
||||
Jpeg License
|
||||
------------
|
||||
============
|
||||
|
||||
In plain English:
|
||||
|
||||
@@ -674,39 +671,8 @@ commercial products, provided that all warranty or liability claims are
|
||||
assumed by the product vendor.
|
||||
|
||||
|
||||
Xiph.org License
|
||||
----------------
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of the Xiph.org Foundation nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION
|
||||
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
PNG License
|
||||
-----------
|
||||
===========
|
||||
|
||||
The PNG Reference Library is supplied "AS IS". The Contributing Authors
|
||||
and Group 42, Inc. disclaim all warranties, expressed or implied,
|
||||
@@ -734,9 +700,8 @@ supporting the PNG file format in commercial products. If you use this
|
||||
source code in a product, acknowledgment is not required but would be
|
||||
appreciated.
|
||||
|
||||
|
||||
Zlib License
|
||||
------------
|
||||
============
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
@@ -754,8 +719,9 @@ Zlib License
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
|
||||
Bzip2 License
|
||||
-------------
|
||||
=============
|
||||
|
||||
This program, "bzip2", the associated library "libbzip2", and all
|
||||
documentation, are copyright (C) 1996-2005 Julian R Seward. All
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
build_exe.py run_game
|
||||
@@ -18,7 +18,8 @@ def main():
|
||||
setup(name="RenPy",
|
||||
windows=[ dict(script="renpy.py",
|
||||
dest_base="renpy",
|
||||
icon_resources=[ (1, "newicon.ico") ] ),
|
||||
icon_resources=[ (1, "newicon.ico") ],
|
||||
),
|
||||
],
|
||||
|
||||
console=[ dict(script="renpy.py", dest_base="console") ],
|
||||
@@ -30,6 +31,7 @@ def main():
|
||||
'pygame.surfarray',
|
||||
'pygame.mixer',
|
||||
'pygame.mixer_music',
|
||||
'pygame.font',
|
||||
'_ssl',
|
||||
'_hashlib',
|
||||
'win32con',
|
||||
@@ -58,6 +60,9 @@ def main():
|
||||
if fn in seen:
|
||||
continue
|
||||
|
||||
if fn == "SDL_mixer.dll":
|
||||
continue
|
||||
|
||||
seen[fn] = True
|
||||
|
||||
zfnew.writestr(fn, zfold.read(fn))
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import glob
|
||||
import os
|
||||
|
||||
files = glob.glob("common/*.rpy")
|
||||
files.sort()
|
||||
|
||||
styles = [ ]
|
||||
|
||||
for fn in files:
|
||||
f = file(fn)
|
||||
|
||||
fi = iter(f)
|
||||
|
||||
for l in iter(fi):
|
||||
|
||||
l = l.strip()
|
||||
|
||||
if l.startswith("### "):
|
||||
|
||||
prefix, style, parent = l.split()
|
||||
|
||||
desc = ""
|
||||
|
||||
for l in fi:
|
||||
|
||||
l = l.strip()
|
||||
if not l.startswith("# "):
|
||||
break
|
||||
|
||||
desc = desc + " " + l[2:]
|
||||
|
||||
styles.append(' style.create("%s", "%s", "%s")' % (style, parent, desc[1:]))
|
||||
|
||||
f.close()
|
||||
|
||||
f = file("common/style.rpy")
|
||||
of = file("common/style.rpy.new", "w")
|
||||
|
||||
fi = iter(f)
|
||||
|
||||
for l in fi:
|
||||
|
||||
of.write(l)
|
||||
|
||||
if l.startswith("# AUTOMATICALLY GENERATED"):
|
||||
|
||||
for l in styles:
|
||||
of.write(l + "\n")
|
||||
|
||||
for l in fi:
|
||||
if l.startswith("# END AUTOMATICALLY GENERATED"):
|
||||
break
|
||||
|
||||
of.write(l)
|
||||
|
||||
f.close()
|
||||
of.close()
|
||||
|
||||
os.rename("common/style.rpy", "common/style.rpy.bak")
|
||||
os.rename("common/style.rpy.new", "common/style.rpy")
|
||||
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 9.0 KiB |
|
Before Width: | Height: | Size: 9.2 KiB |
|
Before Width: | Height: | Size: 8.8 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 8.8 KiB |
|
Before Width: | Height: | Size: 9.5 KiB |
|
Before Width: | Height: | Size: 9.2 KiB |
|
Before Width: | Height: | Size: 9.1 KiB |
|
Before Width: | Height: | Size: 296 B |
|
Before Width: | Height: | Size: 335 B |
@@ -1,697 +0,0 @@
|
||||
# cardgame.rpy - Cardgame support for Ren'Py
|
||||
# Copyright (C) 2008 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# This software may be distributed in modified or unmodified form,
|
||||
# provided:
|
||||
#
|
||||
# (1) This complete license notice is retained.
|
||||
#
|
||||
# (2) This software and all software and data files distributed
|
||||
# alongside this software and intended to be loaded in the same
|
||||
# memory space may be redistributed without requirement for
|
||||
# payment, notification, or other forms of compensation.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
# Commercial licensing for this software is available, please
|
||||
# contact pytom@bishoujo.us for information.
|
||||
|
||||
init python:
|
||||
|
||||
import pygame
|
||||
|
||||
DRAG_NONE = 0
|
||||
DRAG_CARD = 1
|
||||
DRAG_ABOVE = 2
|
||||
DRAG_STACK = 3
|
||||
DRAG_TOP = 4
|
||||
|
||||
# Returns the overlap of the area between the two
|
||||
# rectangles.
|
||||
def __rect_overlap_area(r1, r2):
|
||||
if r1 is None or r2 is None:
|
||||
return 0
|
||||
|
||||
x1, y1, w1, h1 = r1
|
||||
x2, y2, w2, h2 = r2
|
||||
|
||||
maxleft = max(x1, x2)
|
||||
minright = min(x1 + w1, x2 + w2)
|
||||
maxtop = max(y1, y2)
|
||||
minbottom = min(y1 + h1, y2 + h2)
|
||||
|
||||
if minright < maxleft:
|
||||
return 0
|
||||
|
||||
if minbottom < maxtop:
|
||||
return 0
|
||||
|
||||
return (minright - maxleft) * (minbottom - maxtop)
|
||||
|
||||
def __default_can_drag(table, stack, card):
|
||||
return table.get_faceup(card)
|
||||
|
||||
class Table(renpy.Displayable):
|
||||
|
||||
def __init__(self, back=None, base=None, springback=0.1, rotate=0.1, can_drag=__default_can_drag, doubleclick=.33, **kwargs):
|
||||
|
||||
renpy.Displayable.__init__(self, **kwargs)
|
||||
|
||||
# A map from card value to the card object corresponding to
|
||||
# that value.
|
||||
self.cards = { }
|
||||
|
||||
# A list of the stacks that have been defined.
|
||||
self.stacks = [ ]
|
||||
|
||||
# The back of cards that don't have a more specific back
|
||||
# defined.
|
||||
self.back = renpy.easy.displayable_or_none(back)
|
||||
|
||||
# The base of stacks that don't have a more specific base
|
||||
# defined.
|
||||
self.base = renpy.easy.displayable_or_none(base)
|
||||
|
||||
# The amount of time it takes for cards to springback
|
||||
# into their rightful place.
|
||||
self.springback = springback
|
||||
|
||||
# The amount of time it takes for cards to rotate into
|
||||
# their proper orientation.
|
||||
self.rotate = rotate
|
||||
|
||||
# A function that is called to tell if we can drag a
|
||||
# particular card.
|
||||
self.can_drag = can_drag
|
||||
|
||||
# The time between clicks for the click to be considered a
|
||||
# double-click.
|
||||
self.doubleclick = doubleclick
|
||||
|
||||
# Are we sensitive to input? [doc]
|
||||
self.sensitive = True
|
||||
|
||||
# The last click event.
|
||||
self.last_event = CardEvent()
|
||||
|
||||
# The card that has been clicked.
|
||||
self.click_card = None
|
||||
|
||||
# The stack that has been clicked.
|
||||
self.click_stack = None
|
||||
|
||||
# The list of cards that are being dragged.
|
||||
self.drag_cards = [ ]
|
||||
|
||||
# Are we dragging the cards?
|
||||
self.dragging = False
|
||||
|
||||
# The position where we clicked.
|
||||
self.click_x = 0
|
||||
self.click_y = 0
|
||||
|
||||
# The amount of time we've been shown for.
|
||||
self.st = 0
|
||||
|
||||
# This shows the table on the given layer.
|
||||
def show(self, layer='master'):
|
||||
|
||||
for v in self.cards.itervalues():
|
||||
v.offset = __Fixed(0, 0)
|
||||
|
||||
ui.layer(layer)
|
||||
ui.add(self)
|
||||
ui.close()
|
||||
|
||||
# This hides the table.
|
||||
def hide(self, layer='master'):
|
||||
ui.layer(layer)
|
||||
ui.remove(self)
|
||||
ui.close()
|
||||
|
||||
# This controls sensitivity.
|
||||
def set_sensitive(self, value):
|
||||
self.sensitive = value
|
||||
|
||||
def get_card(self, value):
|
||||
if value not in self.cards:
|
||||
raise Exception("No card has the value %r." % value)
|
||||
|
||||
return self.cards[value]
|
||||
|
||||
# This sets the faceup status of a card.
|
||||
def set_faceup(self, card, faceup=True):
|
||||
self.get_card(card).faceup = faceup
|
||||
renpy.redraw(self, 0)
|
||||
|
||||
def get_faceup(self, card):
|
||||
return self.get_card(card).faceup
|
||||
|
||||
# This sets the rotation of a card.
|
||||
def set_rotate(self, card, rotation):
|
||||
__Rotate(self.get_card(card), rotation)
|
||||
renpy.redraw(self, 0)
|
||||
|
||||
def get_rotate(self, card):
|
||||
return self.get_card(card).rotate.rotate_limit()
|
||||
|
||||
def add_marker(self, card, marker):
|
||||
self.get_card(card).markers.append(marker)
|
||||
renpy.redraw(self, 0)
|
||||
|
||||
def remove_marker(self, card, marker):
|
||||
self.get_card(card).markers.remove(marker)
|
||||
renpy.redraw(self, 0)
|
||||
|
||||
# Called to create a new card.
|
||||
def card(self, value, face, back=None):
|
||||
self.cards[value] = __Card(self, value, face, back)
|
||||
|
||||
# Called to create a new stack.
|
||||
def stack(self, x, y, xoff=0, yoff=0, show=1024, base=None,
|
||||
click=False, drag=DRAG_NONE, drop=False, hidden=False):
|
||||
|
||||
rv = __Stack(self, x, y, xoff, yoff, show, base, click, drag, drop, hidden)
|
||||
|
||||
self.stacks.append(rv)
|
||||
return rv
|
||||
|
||||
# Force a redraw on each interaction.
|
||||
def per_interact(self):
|
||||
renpy.redraw(self, 0)
|
||||
|
||||
|
||||
def render(self, width, height, st, at):
|
||||
|
||||
self.st = st
|
||||
|
||||
rv = renpy.Render(width, height)
|
||||
|
||||
for s in self.stacks:
|
||||
|
||||
if s.hidden:
|
||||
s.rect = None
|
||||
for c in s.cards:
|
||||
c.rect = None
|
||||
continue
|
||||
|
||||
s.render_to(rv, width, height, st, at)
|
||||
|
||||
for c in s.cards:
|
||||
c.render_to(rv, width, height, st, at)
|
||||
|
||||
return rv
|
||||
|
||||
def event(self, ev, x, y, st):
|
||||
|
||||
self.st = st
|
||||
|
||||
if not self.sensitive:
|
||||
return
|
||||
|
||||
grabbed = renpy.display.focus.get_grab()
|
||||
|
||||
if (grabbed is not None) and (grabbed is not self):
|
||||
return
|
||||
|
||||
if ev.type == pygame.MOUSEBUTTONDOWN and ev.button == 1:
|
||||
|
||||
if self.click_stack:
|
||||
return
|
||||
|
||||
stack = None
|
||||
card = None
|
||||
|
||||
for s in self.stacks:
|
||||
|
||||
sx, sy, sw, sh = s.rect
|
||||
if sx <= x and sy <= y and sx + sw > x and sy + sh > y:
|
||||
stack = s
|
||||
|
||||
|
||||
for c in s.cards[-s.show:]:
|
||||
if c.rect is None:
|
||||
continue
|
||||
|
||||
cx, cy, cw, ch = c.rect
|
||||
if cx <= x and cy <= y and cx + cw > x and cy + ch > y:
|
||||
card = c
|
||||
stack = c.stack
|
||||
|
||||
if stack is None:
|
||||
return
|
||||
|
||||
# Grab the display.
|
||||
renpy.display.focus.set_grab(self)
|
||||
|
||||
# Don't let the user grab a moving card.
|
||||
if card is not None:
|
||||
xoffset, yoffset = card.offset.offset()
|
||||
if xoffset or yoffset:
|
||||
return
|
||||
|
||||
# Move the stack containing the card to the front.
|
||||
self.stacks.remove(stack)
|
||||
self.stacks.append(stack)
|
||||
|
||||
if stack.click or stack.drag:
|
||||
self.click_card = card
|
||||
self.click_stack = stack
|
||||
|
||||
if card is None or not self.can_drag(self, card.stack, card.value):
|
||||
self.drag_cards = [ ]
|
||||
elif card.stack.drag == DRAG_CARD:
|
||||
self.drag_cards = [ card ]
|
||||
elif card.stack.drag == DRAG_ABOVE:
|
||||
self.drag_cards = [ ]
|
||||
for c in card.stack.cards:
|
||||
if c is card or self.drag_cards:
|
||||
self.drag_cards.append(c)
|
||||
elif card.stack.drag == DRAG_STACK:
|
||||
self.drag_cards = list(card.stack.cards)
|
||||
elif card.stack.drag == DRAG_TOP:
|
||||
if card.stack.cards[-1] is card:
|
||||
self.drag_cards = [ card ]
|
||||
else:
|
||||
self.drag_cards = [ ]
|
||||
|
||||
for c in self.drag_cards:
|
||||
c.offset = __Fixed(0, 0)
|
||||
|
||||
self.click_x = x
|
||||
self.click_y = y
|
||||
self.dragging = False
|
||||
|
||||
renpy.redraw(self, 0)
|
||||
|
||||
raise renpy.IgnoreEvent()
|
||||
|
||||
if ev.type == pygame.MOUSEMOTION or (ev.type == pygame.MOUSEBUTTONUP and ev.button == 1):
|
||||
|
||||
if abs(x - self.click_x) > 7 or abs(y - self.click_y) > 7:
|
||||
self.dragging = True
|
||||
|
||||
dx = x - self.click_x
|
||||
dy = y - self.click_y
|
||||
|
||||
for c in self.drag_cards:
|
||||
xoffset, yoffset = c.offset.offset()
|
||||
|
||||
cdx = dx - xoffset
|
||||
cdy = dy - yoffset
|
||||
|
||||
c.offset = __Fixed(dx, dy)
|
||||
|
||||
if c.rect:
|
||||
cx, cy, cw, ch = c.rect
|
||||
cx += cdx
|
||||
cy += cdy
|
||||
c.rect = (cx, cy, cw, ch)
|
||||
|
||||
area = 0
|
||||
dststack = None
|
||||
dstcard = None
|
||||
|
||||
for s in self.stacks:
|
||||
if not s.drop:
|
||||
continue
|
||||
|
||||
for c in self.drag_cards:
|
||||
|
||||
if c.stack == s:
|
||||
continue
|
||||
a = __rect_overlap_area(c.rect, s.rect)
|
||||
if a >= area:
|
||||
dststack = s
|
||||
dstcard = None
|
||||
area = a
|
||||
|
||||
for c1 in s.cards:
|
||||
a = __rect_overlap_area(c.rect, c1.rect)
|
||||
if a >= area:
|
||||
dststack = s
|
||||
dstcard = c1
|
||||
area = a
|
||||
|
||||
if area == 0:
|
||||
dststack = None
|
||||
dstcard = None
|
||||
|
||||
renpy.redraw(self, 0)
|
||||
|
||||
if ev.type == pygame.MOUSEMOTION:
|
||||
raise renpy.IgnoreEvent()
|
||||
|
||||
if ev.type == pygame.MOUSEBUTTONUP and ev.button == 1:
|
||||
|
||||
# Ungrab the display.
|
||||
renpy.display.focus.set_grab(None)
|
||||
|
||||
evt = None
|
||||
|
||||
if self.dragging:
|
||||
if dststack is not None and self.drag_cards:
|
||||
|
||||
evt = CardEvent()
|
||||
evt.type = "drag"
|
||||
evt.table = self
|
||||
evt.stack = self.click_stack
|
||||
evt.card = self.click_card.value
|
||||
evt.drag_cards = [c.value for c in self.drag_cards]
|
||||
evt.drop_stack = dststack
|
||||
if dstcard:
|
||||
evt.drop_card = dstcard.value
|
||||
evt.time = st
|
||||
|
||||
else:
|
||||
|
||||
if self.click_stack.click:
|
||||
|
||||
evt = CardEvent()
|
||||
evt.type = "click"
|
||||
evt.table = self
|
||||
evt.stack = self.click_stack
|
||||
if self.click_card:
|
||||
evt.card = self.click_card.value
|
||||
else:
|
||||
evt.card = None
|
||||
|
||||
evt.time = st
|
||||
|
||||
if (evt.type == self.last_event.type
|
||||
and evt.stack == self.last_event.stack
|
||||
and evt.card == self.last_event.card
|
||||
and evt.time < self.last_event.time + self.doubleclick):
|
||||
|
||||
evt.type = "doubleclick"
|
||||
|
||||
if evt is not None:
|
||||
self.last_event = evt
|
||||
|
||||
for c in self.drag_cards:
|
||||
c.springback()
|
||||
|
||||
self.click_card = None
|
||||
self.click_stack = None
|
||||
self.drag_cards = [ ]
|
||||
|
||||
if evt is not None:
|
||||
return evt
|
||||
else:
|
||||
raise renpy.IgnoreEvent()
|
||||
|
||||
|
||||
class CardEvent(object):
|
||||
|
||||
def __init__(self):
|
||||
self.type = None
|
||||
self.stack = None
|
||||
self.card = None
|
||||
self.drag_cards = None
|
||||
self.drop_stack = None
|
||||
self.drop_card = None
|
||||
self.time = 0
|
||||
|
||||
# Represents a stack of one or more cards, which can be placed on the
|
||||
# table.
|
||||
class __Stack(object):
|
||||
|
||||
def __init__(
|
||||
self, table,
|
||||
x, y,
|
||||
xoff, yoff,
|
||||
show, base,
|
||||
click, drag, drop,
|
||||
hidden):
|
||||
|
||||
|
||||
# The table this stack belongs to.
|
||||
self.table = table
|
||||
|
||||
# The x and y coordinates of the center of the top card of
|
||||
# this stack.
|
||||
self.x = x
|
||||
self.y = y
|
||||
|
||||
# The offset in the x and y directions of each successive
|
||||
# card.
|
||||
self.xoff = xoff
|
||||
self.yoff = yoff
|
||||
|
||||
# The number of cards to show from this stack. (We show the
|
||||
# last show cards if this is less than the numebr of cards
|
||||
# in the stack.)
|
||||
self.show = show
|
||||
|
||||
# The image that is shown behind the stack. If None, the
|
||||
# background is taken from the table.
|
||||
self.base = base
|
||||
|
||||
# Should we report click events on this stack?
|
||||
self.click = click
|
||||
|
||||
# Should we allow dragging this stack? If so, how?
|
||||
self.drag = drag
|
||||
|
||||
# Should we allow dropping to this stack?
|
||||
self.drop = drop
|
||||
|
||||
# Is this stack hidden?
|
||||
self.hidden = hidden
|
||||
|
||||
# The list of cards in this stack.
|
||||
self.cards = [ ]
|
||||
|
||||
# The rectangle for the background of this effect.
|
||||
self.rect = None
|
||||
|
||||
def insert(self, index, card):
|
||||
card = self.table.get_card(card)
|
||||
|
||||
if card.stack:
|
||||
card.stack.cards.remove(card)
|
||||
|
||||
card.stack = self
|
||||
self.cards.insert(index, card)
|
||||
|
||||
self.table.stacks.remove(self)
|
||||
self.table.stacks.append(self)
|
||||
|
||||
card.springback()
|
||||
|
||||
def append(self, card):
|
||||
if card in self.cards:
|
||||
self.insert(len(self.cards) - 1, card)
|
||||
else:
|
||||
self.insert(len(self.cards), card)
|
||||
|
||||
def remove(self, card):
|
||||
card = self.table.get_card(card)
|
||||
self.cards.remove(card)
|
||||
card.stack = None
|
||||
card.rect = None
|
||||
|
||||
def deal(self):
|
||||
if not self.cards:
|
||||
return None
|
||||
|
||||
card = self.cards[-1]
|
||||
self.remove(card.value)
|
||||
return card.value
|
||||
|
||||
def shuffle(self):
|
||||
renpy.random.shuffle(self.cards)
|
||||
renpy.redraw(self.table, 0)
|
||||
|
||||
def __len__(self):
|
||||
return len(self.cards)
|
||||
|
||||
def __getitem__(self, idx):
|
||||
return self.cards[idx].value
|
||||
|
||||
def __iter__(self):
|
||||
for i in self.cards:
|
||||
yield i.value
|
||||
|
||||
def __contains__(self, item):
|
||||
return self.table.get_card(card) in self.cards
|
||||
|
||||
def render_to(self, rv, width, height, st, at):
|
||||
|
||||
base = self.base or self.table.base
|
||||
|
||||
if base is None:
|
||||
return
|
||||
|
||||
surf = renpy.render(base, width, height, st, at)
|
||||
cw, ch = surf.get_size()
|
||||
|
||||
cx = self.x - cw / 2
|
||||
cy = self.y - ch / 2
|
||||
|
||||
self.rect = (cx, cy, cw, ch)
|
||||
rv.blit(surf, (cx, cy))
|
||||
|
||||
class __Card(object):
|
||||
|
||||
def __init__(self, table, value, face, back):
|
||||
|
||||
# The table this card belongs to.
|
||||
self.table = table
|
||||
|
||||
# The value of this card.
|
||||
self.value = value
|
||||
|
||||
# The face of this card.
|
||||
self.face = renpy.easy.displayable(face)
|
||||
|
||||
# The back of this card. If None, then the back is taken from
|
||||
# the table the card belongs to.
|
||||
self.back = renpy.easy.displayable_or_none(back)
|
||||
|
||||
# Is this card faceup (or face down?)
|
||||
self.faceup = True
|
||||
|
||||
# Object that's called to decide how rotated this card should
|
||||
# be.
|
||||
self.rotate = None
|
||||
|
||||
# A series of highlights that should be drawn over this card.
|
||||
self.highlights = [ ]
|
||||
|
||||
# The stack this card is in.
|
||||
self.stack = None
|
||||
|
||||
# An object that gives the offset of this card relative to
|
||||
# where it would normally be placed.
|
||||
self.offset = __Fixed(0, 0)
|
||||
|
||||
# The rectangle where this card was last drawn to the screen
|
||||
# at.
|
||||
self.rect = None
|
||||
|
||||
__Rotate(self, 0)
|
||||
|
||||
# Returns the base x and y placement of this card.
|
||||
def place(self):
|
||||
s = self.stack
|
||||
offset = max(len(s.cards) - s.show, 0)
|
||||
index = max(s.cards.index(self) - offset, 0)
|
||||
|
||||
return (s.x + s.xoff * index, s.y + s.yoff * index)
|
||||
|
||||
def springback(self):
|
||||
if self.rect is None:
|
||||
self.offset = __Fixed(0, 0)
|
||||
else:
|
||||
self.offset = __Springback(self)
|
||||
|
||||
def render_to(self, rv, width, height, st, at):
|
||||
|
||||
x, y = self.place()
|
||||
xoffset, yoffset = self.offset.offset()
|
||||
x += xoffset
|
||||
y += yoffset
|
||||
|
||||
if self.faceup:
|
||||
d = self.face
|
||||
else:
|
||||
d = self.back or self.table.back
|
||||
|
||||
# TODO: Figure out if we can reuse some of this.
|
||||
|
||||
if self.highlights:
|
||||
d = Fixed(* ([d] + [renpy.easy.displayable(i) for i in self.highlights]))
|
||||
|
||||
r = self.rotate.rotate()
|
||||
if r:
|
||||
d = RotoZoom(r, r, 0, 1, 1, 0)(d)
|
||||
|
||||
surf = renpy.render(d, width, height, st, at)
|
||||
w, h = surf.get_size()
|
||||
|
||||
x -= w / 2
|
||||
y -= h / 2
|
||||
|
||||
self.rect = (x, y, w, h)
|
||||
|
||||
rv.blit(surf, (x, y))
|
||||
|
||||
def __repr__(self):
|
||||
return "<__Card %r>" % self.value
|
||||
|
||||
|
||||
class __Springback(object):
|
||||
|
||||
def __init__(self, card):
|
||||
self.card = card
|
||||
self.table = table = card.table
|
||||
|
||||
self.start = table.st
|
||||
|
||||
cx, cy, cw, ch = self.card.rect
|
||||
x = cx + cw / 2
|
||||
y = cy + ch / 2
|
||||
|
||||
self.startx = x
|
||||
self.starty = y
|
||||
|
||||
def offset(self):
|
||||
|
||||
t = (self.table.st - self.start) / self.table.springback
|
||||
t = min(t, 1.0)
|
||||
|
||||
if t < 1.0:
|
||||
renpy.redraw(self.table, 0)
|
||||
|
||||
px, py = self.card.place()
|
||||
|
||||
return int((self.startx - px) * (1.0 - t)), int((self.starty - py) * (1.0 - t))
|
||||
|
||||
|
||||
class __Fixed(object):
|
||||
def __init__(self, x, y):
|
||||
self.x = x
|
||||
self.y = y
|
||||
|
||||
def offset(self):
|
||||
return self.x, self.y
|
||||
|
||||
|
||||
class __Rotate(object):
|
||||
def __init__(self, card, amount):
|
||||
|
||||
self.table = table = card.table
|
||||
self.start = table.st
|
||||
|
||||
if card.rotate is None:
|
||||
self.start_rotate = amount
|
||||
else:
|
||||
self.start_rotate = card.rotate.rotate()
|
||||
|
||||
self.end_rotate = amount
|
||||
|
||||
card.rotate = self
|
||||
|
||||
|
||||
def rotate(self):
|
||||
|
||||
if self.start_rotate == self.end_rotate:
|
||||
return self.start_rotate
|
||||
|
||||
t = (self.table.st - self.start) / self.table.springback
|
||||
t = min(t, 1.0)
|
||||
|
||||
if t < 1.0:
|
||||
renpy.redraw(self.table, 0)
|
||||
|
||||
return self.start_rotate + (self.end_rotate - self.start_rotate) * t
|
||||
|
||||
def rotate_limit(self):
|
||||
return self.end_rotate
|
||||
|
Before Width: | Height: | Size: 140 KiB |
@@ -1,336 +0,0 @@
|
||||
# klondike.rpy - Klondike Solitaire
|
||||
# Copyright (C) 2008 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# This software may be distributed in modified or unmodified form,
|
||||
# provided:
|
||||
#
|
||||
# (1) This complete license notice is retained.
|
||||
#
|
||||
# (2) This software and all software and data files distributed
|
||||
# alongside this software and intended to be loaded in the same
|
||||
# memory space may be redistributed without requirement for
|
||||
# payment, notification, or other forms of compensation.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
# Commercial licensing for this software is available, please
|
||||
# contact pytom@bishoujo.us for information.
|
||||
|
||||
init python:
|
||||
|
||||
class Klondike(object):
|
||||
|
||||
# We represent a card as a (suit, rank) tuple. The suit is one of the
|
||||
# following four constants, while the rank is 1 for ace, 2 for 2,
|
||||
# ..., 10 for 10, 11 for jack, 12 for queen, 13 for king.
|
||||
CLUB = 0
|
||||
SPADE = 1
|
||||
HEART = 2
|
||||
DIAMOND = 3
|
||||
|
||||
def __init__(self, deal=3):
|
||||
|
||||
# Constants that let us easily change where the game is
|
||||
# located.
|
||||
LEFT=140
|
||||
TOP=58
|
||||
COL_SPACING = 90
|
||||
ROW_SPACING = 120
|
||||
CARD_XSPACING = 20
|
||||
CARD_YSPACING = 30
|
||||
|
||||
# Store the parameters.
|
||||
self.deal = deal
|
||||
|
||||
# Create the table, stock, and waste.
|
||||
self.table = t = Table(base="card/base.png", back="card/back.png")
|
||||
self.stock = t.stack(LEFT, TOP, xoff=0, yoff=0, click=True)
|
||||
self.waste = t.stack(LEFT + COL_SPACING, TOP, xoff=CARD_XSPACING, drag=DRAG_TOP, show=self.deal, click=True)
|
||||
|
||||
# The 4 foundation stacks.
|
||||
self.foundations = [ ]
|
||||
for i in range(0, 4):
|
||||
s = t.stack(LEFT + COL_SPACING * (i + 3), TOP, xoff=0, yoff=0, drag=DRAG_TOP, drop=True)
|
||||
self.foundations.append(s)
|
||||
|
||||
# The 7 tableau stacks.
|
||||
self.tableau = [ ]
|
||||
for i in range(0, 7):
|
||||
s = t.stack(LEFT + COL_SPACING * i, TOP + ROW_SPACING, xoff=0, yoff=CARD_YSPACING, drag=DRAG_ABOVE, click=True, drop=True)
|
||||
self.tableau.append(s)
|
||||
|
||||
# Create the stock and shuffle it.
|
||||
for rank in range(1, 14):
|
||||
for suit in range(0, 4):
|
||||
value = (suit, rank)
|
||||
t.card(value, "card/%d.png" % self.card_num(suit, rank))
|
||||
t.set_faceup(value, False)
|
||||
self.stock.append(value)
|
||||
|
||||
self.stock.shuffle()
|
||||
|
||||
# Deal out the initial tableau.
|
||||
for i in range(0, 7):
|
||||
for j in range(i, 7):
|
||||
c = self.stock.deal()
|
||||
self.tableau[j].append(c)
|
||||
|
||||
# Ensure that the bottom of each tableau is faceup.
|
||||
for i in range(0, 7):
|
||||
if self.tableau[i]:
|
||||
self.table.set_faceup(self.tableau[i][-1], True)
|
||||
|
||||
|
||||
# This figures out the image filename for a given suit and rank.
|
||||
def card_num(self, suit, rank):
|
||||
ranks = [ None, 1, 49, 45, 41, 37, 33, 29, 25, 21, 17, 13, 9, 5 ]
|
||||
return suit + ranks[rank]
|
||||
|
||||
def show(self):
|
||||
self.table.show()
|
||||
|
||||
def hide(self):
|
||||
self.table.hide()
|
||||
|
||||
def tableau_drag(self, evt):
|
||||
|
||||
card = evt.drag_cards[0]
|
||||
cards = evt.drag_cards
|
||||
stack = evt.drop_stack
|
||||
|
||||
csuit, crank = card
|
||||
|
||||
# If the stack is empty, allow a king to be dragged to it.
|
||||
if not stack:
|
||||
if crank == 13:
|
||||
for i in cards:
|
||||
stack.append(i)
|
||||
|
||||
return "tableau_drag"
|
||||
|
||||
# Otherwise, the stack has a bottom card.
|
||||
bottom = stack[-1]
|
||||
bsuit, brank = bottom
|
||||
|
||||
# Figure out which of the stacks are black.
|
||||
cblack = (csuit == self.SPADE) or (csuit == self.CLUB)
|
||||
bblack = (bsuit == self.SPADE) or (bsuit == self.CLUB)
|
||||
|
||||
# Can we legally place the cards?
|
||||
if (bblack != cblack) and (crank == brank - 1):
|
||||
|
||||
# Place the cards:
|
||||
for i in cards:
|
||||
stack.append(i)
|
||||
|
||||
return "tableau_drag"
|
||||
|
||||
return False
|
||||
|
||||
def foundation_drag(self, evt):
|
||||
|
||||
# We can only drag one card at a time to a foundation.
|
||||
if len(evt.drag_cards) != 1:
|
||||
return False
|
||||
|
||||
suit, rank = evt.drag_cards[0]
|
||||
|
||||
# If there is a card on the foundation already, then
|
||||
# check to see if we're dropping then next one in
|
||||
# sequence.
|
||||
if len(evt.drop_stack):
|
||||
dsuit, drank = evt.drop_stack[-1]
|
||||
if suit == dsuit and rank == drank + 1:
|
||||
evt.drop_stack.append(evt.drag_cards[0])
|
||||
return "foundation_drag"
|
||||
|
||||
# Otherwise, make sure we're dropping an ace.
|
||||
else:
|
||||
if rank == 1:
|
||||
evt.drop_stack.append(evt.drag_cards[0])
|
||||
return "foundation_drag"
|
||||
|
||||
return False
|
||||
|
||||
def tableau_doubleclick(self, evt):
|
||||
|
||||
# Make sure that there's at least one card in the stack.
|
||||
if not evt.stack:
|
||||
return False
|
||||
|
||||
# The bottom card in the stack.
|
||||
card = evt.stack[-1]
|
||||
suit, rank = card
|
||||
|
||||
# If the card is an ace, find an open foundation and put it
|
||||
# there.
|
||||
if rank == 1:
|
||||
for i in self.foundations:
|
||||
if not i:
|
||||
i.append(card)
|
||||
break
|
||||
return "foundation_drag"
|
||||
|
||||
# Otherwise, see if there's a foundation where we can put
|
||||
# the card.
|
||||
for i in self.foundations:
|
||||
if not i:
|
||||
continue
|
||||
|
||||
fsuit, frank = i[-1]
|
||||
if suit == fsuit and rank == frank + 1:
|
||||
i.append(card)
|
||||
return "foundation_drag"
|
||||
|
||||
return False
|
||||
|
||||
def stock_click(self, evt):
|
||||
|
||||
# If there are cards in the stock, dispense up to three3
|
||||
# of them.
|
||||
if self.stock:
|
||||
for i in range(0, self.deal):
|
||||
if self.stock:
|
||||
c = self.stock[-1]
|
||||
self.table.set_faceup(c, True)
|
||||
self.waste.append(c)
|
||||
|
||||
return "stock_click"
|
||||
|
||||
# Otherwise, move the contents of the waste to the stock.
|
||||
else:
|
||||
while self.waste:
|
||||
c = self.waste[-1]
|
||||
self.table.set_faceup(c, False)
|
||||
self.stock.append(c)
|
||||
|
||||
return "stock_click"
|
||||
|
||||
|
||||
def interact(self):
|
||||
|
||||
evt = ui.interact()
|
||||
rv = False
|
||||
|
||||
# Check the various events, and dispatch them to the methods
|
||||
# that handle them.
|
||||
if evt.type == "drag":
|
||||
if evt.drop_stack in self.tableau:
|
||||
rv = self.tableau_drag(evt)
|
||||
|
||||
elif evt.drop_stack in self.foundations:
|
||||
rv = self.foundation_drag(evt)
|
||||
|
||||
elif evt.type == "click":
|
||||
if evt.stack == self.stock:
|
||||
rv = self.stock_click(evt)
|
||||
|
||||
elif evt.type == "doubleclick":
|
||||
if (evt.stack in self.tableau) or (evt.stack is self.waste):
|
||||
rv = self.tableau_doubleclick(evt)
|
||||
|
||||
# Ensure that the bottom card in each tableau is faceup.
|
||||
for i in range(0, 7):
|
||||
if self.tableau[i]:
|
||||
self.table.set_faceup(self.tableau[i][-1], True)
|
||||
|
||||
# Check to see if any of the foundations has less than
|
||||
# 13 cards in it. If it does, return False. Otherwise,
|
||||
# return True.
|
||||
for i in self.foundations:
|
||||
if len(i) != 13:
|
||||
return rv
|
||||
|
||||
return "win"
|
||||
|
||||
# Sets things as sensitive (or not).
|
||||
def set_sensitive(self, value):
|
||||
self.table.set_sensitive(value)
|
||||
|
||||
# Utility functions.
|
||||
|
||||
# Is it okay to drag the over card onto under, where under is
|
||||
# part of a tableau.
|
||||
def can_hint(self, under, over):
|
||||
usuit, urank = under
|
||||
osuit, orank = over
|
||||
|
||||
if orank == 1:
|
||||
return False
|
||||
|
||||
ublack = (usuit == self.SPADE) or (usuit == self.CLUB)
|
||||
oblack = (osuit == self.SPADE) or (osuit == self.CLUB)
|
||||
|
||||
if (oblack != ublack) and (orank == urank - 1):
|
||||
return True
|
||||
|
||||
# Returns the first faceup card in the stack.
|
||||
def first_faceup(self, s):
|
||||
for c in s:
|
||||
if self.table.get_faceup(c):
|
||||
return c
|
||||
|
||||
# This tries to find a reasonable hint, and returns it as a
|
||||
# pair of cardnames.
|
||||
def hint(self):
|
||||
|
||||
for i in self.tableau:
|
||||
if not i:
|
||||
continue
|
||||
|
||||
over = self.first_faceup(i)
|
||||
|
||||
for j in self.tableau:
|
||||
if not j or i is j:
|
||||
continue
|
||||
|
||||
under = j[-1]
|
||||
|
||||
if self.can_hint(under, over):
|
||||
return (under, over)
|
||||
|
||||
if self.waste:
|
||||
|
||||
over = self.waste[-1]
|
||||
|
||||
for j in self.tableau:
|
||||
if not j:
|
||||
continue
|
||||
|
||||
under = j[-1]
|
||||
|
||||
if self.can_hint(under, over):
|
||||
return (under, over)
|
||||
|
||||
return None, None
|
||||
|
||||
def card_name(self, c):
|
||||
suit, rank = c
|
||||
|
||||
return [
|
||||
"INVALID",
|
||||
"Ace",
|
||||
"Two",
|
||||
"Three",
|
||||
"four",
|
||||
"Five",
|
||||
"Six",
|
||||
"Seven",
|
||||
"Eight",
|
||||
"Nine",
|
||||
"Ten",
|
||||
"Jack",
|
||||
"Queen",
|
||||
"King" ][rank] + " of " + [
|
||||
"Clubs",
|
||||
"Spades",
|
||||
"Hearts",
|
||||
"Diamonds" ][suit]
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 138 KiB |
@@ -1,247 +0,0 @@
|
||||
## This file contains some of the options that can be changed to customize
|
||||
## your Ren'Py game. It only contains the most common options... there
|
||||
## is quite a bit more customization you can do.
|
||||
##
|
||||
## Lines beginning with two '#' marks are comments, and you shouldn't
|
||||
## uncomment them. Lines beginning with a single '#' mark are
|
||||
## commented-out code, and you may want to uncomment them when
|
||||
## appropriate.
|
||||
|
||||
init -1 python hide:
|
||||
|
||||
## Should we enable the use of developer tools? This should be
|
||||
## set to False before the game is released, so the user can't
|
||||
## cheat using developer tools.
|
||||
|
||||
config.developer = True
|
||||
|
||||
## These control the width and height of the screen.
|
||||
|
||||
config.screen_width = 800
|
||||
config.screen_height = 600
|
||||
|
||||
## This controls the title of the window, when Ren'Py is
|
||||
## running in a window.
|
||||
|
||||
config.window_title = u"Ren'Py Cardgame Demo"
|
||||
|
||||
#########################################
|
||||
# Layouts
|
||||
|
||||
## This enables the use of an in-game menu that is made out of
|
||||
## buttons.
|
||||
|
||||
layout.button_menu()
|
||||
|
||||
#########################################
|
||||
# Themes
|
||||
|
||||
## We then want to call a theme function. themes.roundrect is
|
||||
## a theme that features the use of rounded rectangles. It's
|
||||
## the only theme we currently support.
|
||||
##
|
||||
## The theme function takes a number of parameters that can
|
||||
## customize the color scheme.
|
||||
|
||||
theme.roundrect(
|
||||
|
||||
## The color of an idle widget face.
|
||||
widget = "#7AA27B",
|
||||
|
||||
## The color of a focused widget face.
|
||||
widget_hover = "#A3C7A3",
|
||||
|
||||
## The color of the text in a widget.
|
||||
widget_text = "#CDE0CE",
|
||||
|
||||
## The color of the text in a selected widget. (For
|
||||
## example, the current value of a preference.)
|
||||
widget_selected = "#ffffff",
|
||||
|
||||
## The color of a disabled widget face.
|
||||
disabled = "#426143",
|
||||
|
||||
## The color of disabled widget text.
|
||||
disabled_text = "#819981",
|
||||
|
||||
## The color of informational labels.
|
||||
label = "#ffffff",
|
||||
|
||||
## The color of a frame containing widgets.
|
||||
frame = "#245536",
|
||||
|
||||
## If this is True, the in-game window is rounded. If False,
|
||||
## the in-game window is square.
|
||||
rounded_window = False,
|
||||
|
||||
## The background of the main menu. This can be a color
|
||||
## beginning with '#', or an image filename. The latter
|
||||
## should take up the full height and width of the screen.
|
||||
mm_root = "mainmenu.jpg",
|
||||
|
||||
## The background of the game menu. This can be a color
|
||||
## beginning with '#', or an image filename. The latter
|
||||
## should take up the full height and width of the screen.
|
||||
gm_root = "table.jpg",
|
||||
|
||||
## And we're done with the theme. The theme will customize
|
||||
## various styles, so if we want to change them, we should
|
||||
## do so below.
|
||||
)
|
||||
|
||||
|
||||
#########################################
|
||||
## These settings let you customize the window containing the
|
||||
## dialogue and narration, by replacing it with an image.
|
||||
|
||||
## The background of the window. In a Frame, the two numbers
|
||||
## are the size of the left/right and top/bottom borders,
|
||||
## respectively.
|
||||
|
||||
# style.window.background = Frame("frame.png", 12, 12)
|
||||
|
||||
## Margin is space surrounding the window, where the background
|
||||
## is not drawn.
|
||||
|
||||
# style.window.left_margin = 6
|
||||
# style.window.right_margin = 6
|
||||
# style.window.top_margin = 6
|
||||
# style.window.bottom_margin = 6
|
||||
|
||||
## Padding is space inside the window, where the background is
|
||||
## drawn.
|
||||
|
||||
# style.window.left_padding = 6
|
||||
# style.window.right_padding = 6
|
||||
# style.window.top_padding = 6
|
||||
# style.window.bottom_padding = 6
|
||||
|
||||
## This is the minimum height of the window, including the margins
|
||||
## and padding.
|
||||
|
||||
# style.window.yminimum = 250
|
||||
|
||||
|
||||
#########################################
|
||||
## This lets you change the placement of the main menu.
|
||||
|
||||
## The way placement works is that we find an anchor point
|
||||
## inside a displayable, and a position (pos) point on the
|
||||
## screen. We then place the displayable so the two points are
|
||||
## at the same place.
|
||||
|
||||
## An anchor/pos can be given as an integer or a floating point
|
||||
## number. If an integer, the number is interpreted as a number
|
||||
## of pixels from the upper-left corner. If a floating point,
|
||||
## the number is interpreted as a fraction of the size of the
|
||||
## displayable or screen.
|
||||
|
||||
# style.mm_menu_frame.xpos = 0.5
|
||||
# style.mm_menu_frame.xanchor = 0.5
|
||||
# style.mm_menu_frame.ypos = 0.75
|
||||
# style.mm_menu_frame.yanchor = 0.5
|
||||
|
||||
|
||||
#########################################
|
||||
## These let you customize the default font used for text in Ren'Py.
|
||||
|
||||
## The file containing the default font.
|
||||
|
||||
# style.default.font = "DejaVuSans.ttf"
|
||||
|
||||
## The default size of text.
|
||||
|
||||
# style.default.size = 22
|
||||
|
||||
## Note that these only change the size of some of the text. Other
|
||||
## buttons have their own styles.
|
||||
|
||||
|
||||
#########################################
|
||||
## These settings let you change some of the sounds that are used by
|
||||
## Ren'Py.
|
||||
|
||||
## Set this to False if the game does not have any sound effects.
|
||||
|
||||
config.has_sound = True
|
||||
|
||||
## Set this to False if the game does not have any music.
|
||||
|
||||
config.has_music = True
|
||||
|
||||
## Set this to False if the game does not have voicing.
|
||||
|
||||
config.has_voice = True
|
||||
|
||||
## Sounds that are used when button and imagemaps are clicked.
|
||||
|
||||
# style.button.activate_sound = "click.wav"
|
||||
# style.imagemap.activate_sound = "click.wav"
|
||||
|
||||
## Sounds that are used when entering and exiting the game menu.
|
||||
|
||||
# config.enter_sound = "click.wav"
|
||||
# config.exit_sound = "click.wav"
|
||||
|
||||
## A sample sound that can be played to check the sound volume.
|
||||
|
||||
# config.sample_sound = "click.wav"
|
||||
|
||||
## Music that is played while the user is at the main menu.
|
||||
|
||||
# config.main_menu_music = "main_menu_theme.ogg"
|
||||
|
||||
|
||||
#########################################
|
||||
## Transitions.
|
||||
|
||||
## Used when entering the game menu from the game.
|
||||
|
||||
config.enter_transition = dissolve
|
||||
|
||||
## Used when exiting the game menu to the game.
|
||||
|
||||
config.exit_transition = dissolve
|
||||
|
||||
## Used between screens of the game menu.
|
||||
|
||||
config.intra_transition = dissolve
|
||||
|
||||
## Used when entering the game menu from the main menu.
|
||||
|
||||
config.main_game_transition = dissolve
|
||||
|
||||
## Used when returning to the main menu from the game.
|
||||
|
||||
config.game_main_transition = dissolve
|
||||
|
||||
## Used when entering the main menu from the splashscreen.
|
||||
|
||||
config.end_splash_transition = dissolve
|
||||
|
||||
## Used when entering the main menu after the game has ended.
|
||||
|
||||
config.end_game_transition = fade
|
||||
|
||||
## Used when a game is loaded.
|
||||
|
||||
config.after_load_transition = dissolve
|
||||
|
||||
|
||||
#########################################
|
||||
## Default values of Preferences.
|
||||
|
||||
## Note: These options are only evaluated the first time a
|
||||
## game is run. To have them run a second time, delete
|
||||
## game/saves/persistent
|
||||
|
||||
## Should we start in fullscreen mode?
|
||||
|
||||
config.default_fullscreen = False
|
||||
|
||||
## The default text speed in characters per second. 0 is infinite.
|
||||
|
||||
config.default_text_cps = 0
|
||||
|
||||
config.save_directory = "cardgame-11754"
|
||||
|
||||
@@ -1,184 +0,0 @@
|
||||
# You can place the script of your game in this file.
|
||||
|
||||
init:
|
||||
$ e = Character('Eileen', color="#c8ffc8")
|
||||
|
||||
image eileen happy = "eileen_happy.png"
|
||||
image bg table = "table.jpg"
|
||||
image dim = "#0008"
|
||||
|
||||
# Some styles for show text.
|
||||
$ style.centered_text.drop_shadow = (2, 2)
|
||||
$ style.centered_text.drop_shadow_color = "#000b"
|
||||
|
||||
label start:
|
||||
|
||||
scene bg table
|
||||
|
||||
python:
|
||||
k = Klondike(1)
|
||||
k.set_sensitive(False)
|
||||
k.show()
|
||||
|
||||
show dim
|
||||
show eileen happy
|
||||
with dissolve
|
||||
|
||||
e "Welcome to the cardgame demo. Let's play some solitaire!"
|
||||
|
||||
e "I might show up from time to time to give you some advice, but it's up to you if you want to take it."
|
||||
|
||||
e "Good luck!"
|
||||
|
||||
label continue:
|
||||
|
||||
hide dim
|
||||
hide eileen
|
||||
with dissolve
|
||||
|
||||
label quick_continue:
|
||||
|
||||
$ hint_count = renpy.random.randint(10, 20)
|
||||
|
||||
while True:
|
||||
|
||||
python:
|
||||
|
||||
ui.textbutton("Give Up", ui.jumps("giveup"), xalign=.02, yalign=.98)
|
||||
k.set_sensitive(True)
|
||||
event = k.interact()
|
||||
|
||||
if event:
|
||||
renpy.checkpoint()
|
||||
|
||||
if event == "win":
|
||||
jump win
|
||||
|
||||
if event == "tableau_drag" or event == "stock_click":
|
||||
$ hint_count -= 1
|
||||
if hint_count <= 0:
|
||||
jump hint
|
||||
|
||||
label win:
|
||||
|
||||
show dim
|
||||
show eileen happy
|
||||
with dissolve
|
||||
|
||||
"Congratulations!"
|
||||
|
||||
jump newgame
|
||||
|
||||
label giveup:
|
||||
|
||||
$ k.set_sensitive(False)
|
||||
|
||||
show dim
|
||||
show eileen happy
|
||||
with dissolve
|
||||
|
||||
menu:
|
||||
e "Are you sure you want to give up?"
|
||||
|
||||
"Yes":
|
||||
|
||||
"Oh well, better luck next time."
|
||||
|
||||
jump newgame
|
||||
|
||||
"No":
|
||||
|
||||
jump continue
|
||||
|
||||
label newgame:
|
||||
|
||||
menu:
|
||||
e "Would you like to try again?"
|
||||
|
||||
"Yes":
|
||||
pass
|
||||
|
||||
"No":
|
||||
e "Well, I hope to see you again soon."
|
||||
return
|
||||
|
||||
e "Okay, here we go!"
|
||||
|
||||
scene bg table
|
||||
|
||||
python:
|
||||
k = Klondike(1)
|
||||
k.sensitive = False
|
||||
k.show()
|
||||
|
||||
jump continue
|
||||
|
||||
|
||||
label hint:
|
||||
|
||||
$ under, over = k.hint()
|
||||
|
||||
$ print under, over
|
||||
|
||||
if under is None:
|
||||
jump quick_continue
|
||||
|
||||
$ under = k.card_name(under)
|
||||
$ over = k.card_name(over)
|
||||
|
||||
$ k.set_sensitive(False)
|
||||
|
||||
show dim
|
||||
show eileen happy
|
||||
with dissolve
|
||||
|
||||
$ hint = renpy.random.randint(0, 2)
|
||||
|
||||
if hint == 0:
|
||||
e "Maybe put the %(over)s on top of the %(under)s."
|
||||
|
||||
elif hint == 1:
|
||||
e "You can try moving the %(over)s to the %(under)s."
|
||||
|
||||
elif hint == 2:
|
||||
e "I think something can go on the %(under)s."
|
||||
|
||||
jump continue
|
||||
|
||||
|
||||
# This has nothing to do with card games.
|
||||
label splashscreen:
|
||||
|
||||
scene bg table
|
||||
$ renpy.pause(1.0)
|
||||
|
||||
show text "According to legend, prospectors in the klondike would carry with them a deck of cards."
|
||||
with dissolve
|
||||
with Pause(5.0)
|
||||
hide text
|
||||
with dissolve
|
||||
with Pause(1.0)
|
||||
|
||||
show text "If they were ever lost, they'd start playing a game of solitaire."
|
||||
with dissolve
|
||||
with Pause(4.0)
|
||||
hide text
|
||||
with dissolve
|
||||
with Pause(1.0)
|
||||
|
||||
show text "Without fail, help would soon arrive..."
|
||||
with dissolve
|
||||
with Pause(3.0)
|
||||
hide text
|
||||
with dissolve
|
||||
with Pause(1.0)
|
||||
|
||||
show text "... saying \"put the Five of Spades on the Six of Hearts.\""
|
||||
|
||||
with dissolve
|
||||
with Pause(4.0)
|
||||
hide text
|
||||
with dissolve
|
||||
with Pause(1.0)
|
||||
|
||||
return
|
||||
|
Before Width: | Height: | Size: 116 KiB |
@@ -54,6 +54,9 @@ init 1210 python hide::
|
||||
if compat(6, 2, 0):
|
||||
config.reject_backslash = False
|
||||
|
||||
if compat(6, 9, 0):
|
||||
style.motion.clear()
|
||||
|
||||
if "Fullscreen" in config.translations:
|
||||
fs = _("Fullscreen")
|
||||
config.translations.setdefault("Fullscreen 4:3", fs + " 4:3")
|
||||
|
||||
@@ -62,60 +62,69 @@ init -1110 python:
|
||||
return .5 - math.cos(math.pi * x) / 2.0
|
||||
|
||||
# This defines a family of move transitions.
|
||||
def move_transitions(prefix, delay, time_warp=None, in_time_warp=None, out_time_warp=None, old=False):
|
||||
def move_transitions(prefix, delay, time_warp=None, in_time_warp=None, out_time_warp=None, old=False, layers=[ 'master' ], **kwargs):
|
||||
moves = {
|
||||
"" : MoveTransition(
|
||||
delay,
|
||||
old=old,
|
||||
factory=MoveFactory(time_warp=time_warp)),
|
||||
layers=layers,
|
||||
factory=MoveFactory(time_warp=time_warp, **kwargs)),
|
||||
|
||||
"inright" : MoveTransition(
|
||||
delay,
|
||||
old=old,
|
||||
factory=MoveFactory(time_warp=time_warp),
|
||||
enter_factory=MoveIn((1.0, None, 0.0, None), time_warp=in_time_warp)),
|
||||
layers=layers,
|
||||
factory=MoveFactory(time_warp=time_warp, **kwargs),
|
||||
enter_factory=MoveIn((1.0, None, 0.0, None), time_warp=in_time_warp, **kwargs)),
|
||||
|
||||
"inleft" : MoveTransition(
|
||||
delay,
|
||||
old=old,
|
||||
factory=MoveFactory(time_warp=time_warp),
|
||||
enter_factory=MoveIn((0.0, None, 1.0, None), time_warp=in_time_warp)),
|
||||
layers=layers,
|
||||
factory=MoveFactory(time_warp=time_warp, **kwargs),
|
||||
enter_factory=MoveIn((0.0, None, 1.0, None), time_warp=in_time_warp, **kwargs)),
|
||||
|
||||
"intop" : MoveTransition(
|
||||
delay,
|
||||
old=old,
|
||||
factory=MoveFactory(time_warp=time_warp),
|
||||
enter_factory=MoveIn((None, 0.0, None, 1.0), time_warp=in_time_warp)),
|
||||
layers=layers,
|
||||
factory=MoveFactory(time_warp=time_warp, **kwargs),
|
||||
enter_factory=MoveIn((None, 0.0, None, 1.0), time_warp=in_time_warp, **kwargs)),
|
||||
|
||||
"inbottom" : MoveTransition(
|
||||
delay,
|
||||
old=old,
|
||||
factory=MoveFactory(time_warp=time_warp),
|
||||
enter_factory=MoveIn((None, 1.0, None, 0.0), time_warp=in_time_warp)),
|
||||
layers=layers,
|
||||
factory=MoveFactory(time_warp=time_warp, **kwargs),
|
||||
enter_factory=MoveIn((None, 1.0, None, 0.0), time_warp=in_time_warp, **kwargs)),
|
||||
|
||||
"outright" : MoveTransition(
|
||||
delay,
|
||||
old=old,
|
||||
factory=MoveFactory(time_warp=time_warp),
|
||||
leave_factory=MoveOut((1.0, None, 0.0, None), time_warp=out_time_warp)),
|
||||
layers=layers,
|
||||
factory=MoveFactory(time_warp=time_warp, **kwargs),
|
||||
leave_factory=MoveOut((1.0, None, 0.0, None), time_warp=out_time_warp, **kwargs)),
|
||||
|
||||
"outleft" : MoveTransition(
|
||||
delay,
|
||||
old=old,
|
||||
factory=MoveFactory(time_warp=time_warp),
|
||||
leave_factory=MoveOut((0.0, None, 1.0, None), time_warp=out_time_warp)),
|
||||
layers=layers,
|
||||
factory=MoveFactory(time_warp=time_warp, **kwargs),
|
||||
leave_factory=MoveOut((0.0, None, 1.0, None), time_warp=out_time_warp, **kwargs)),
|
||||
|
||||
"outtop" : MoveTransition(
|
||||
delay,
|
||||
old=old,
|
||||
factory=MoveFactory(time_warp=time_warp),
|
||||
leave_factory=MoveOut((None, 0.0, None, 1.0), time_warp=out_time_warp)),
|
||||
layers=layers,
|
||||
factory=MoveFactory(time_warp=time_warp, **kwargs),
|
||||
leave_factory=MoveOut((None, 0.0, None, 1.0), time_warp=out_time_warp, **kwargs)),
|
||||
|
||||
"outbottom" : MoveTransition(
|
||||
delay,
|
||||
old=old,
|
||||
factory=MoveFactory(time_warp=time_warp),
|
||||
leave_factory=MoveOut((None, 1.0, None, 0.0), time_warp=time_warp)),
|
||||
layers=layers,
|
||||
factory=MoveFactory(time_warp=time_warp, **kwargs),
|
||||
leave_factory=MoveOut((None, 1.0, None, 0.0), time_warp=time_warp, **kwargs)),
|
||||
}
|
||||
|
||||
for k, v in moves.iteritems():
|
||||
|
||||
@@ -18,7 +18,7 @@ init -1105 python:
|
||||
|
||||
# This takes care of actually displaying button menus.
|
||||
def _display_button_menu(menuitems):
|
||||
|
||||
|
||||
narration = [ s for s, i in menuitems if i is None and s ]
|
||||
menuitems = [ (s, i) for s, i in menuitems if i is not None or not s ]
|
||||
|
||||
|
||||
@@ -69,6 +69,12 @@ init -1180 python:
|
||||
|
||||
config.with_callback = _default_with_callback
|
||||
|
||||
|
||||
def _default_empty_window():
|
||||
store.narrator("", interact=False)
|
||||
|
||||
config.empty_window = _default_empty_window
|
||||
|
||||
style.skip_indicator = Style(style.default, heavy=True, help='The skip indicator.')
|
||||
style.skip_indicator.xpos = 10
|
||||
style.skip_indicator.ypos = 10
|
||||
@@ -284,7 +290,7 @@ label _hide_windows:
|
||||
python:
|
||||
_windows_hidden = True
|
||||
ui.saybehavior(dismiss=['dismiss', 'hide_windows'])
|
||||
ui.interact(suppress_overlay=True)
|
||||
ui.interact(suppress_overlay=True, suppress_window=True)
|
||||
_windows_hidden = False
|
||||
|
||||
return
|
||||
@@ -509,7 +515,7 @@ init 1180 python:
|
||||
|
||||
label _enter_menu:
|
||||
python hide:
|
||||
renpy.movie_stop()
|
||||
renpy.movie_stop(only_fullscreen=True)
|
||||
renpy.take_screenshot((config.thumbnail_width, config.thumbnail_height))
|
||||
|
||||
renpy.context()._menu = True
|
||||
@@ -518,9 +524,11 @@ label _enter_menu:
|
||||
renpy.context().main_menu = False
|
||||
renpy.context_dynamic("main_menu")
|
||||
renpy.context_dynamic("_window_subtitle")
|
||||
|
||||
renpy.context_dynamic("_window")
|
||||
|
||||
store.main_menu = False
|
||||
store._window_subtitle = config.menu_window_subtitle
|
||||
store._window = False
|
||||
|
||||
store.mouse_visible = True
|
||||
store.suppress_overlay = True
|
||||
@@ -599,7 +607,7 @@ label _return:
|
||||
|
||||
if renpy.context().main_menu:
|
||||
$ renpy.transition(config.game_main_transition)
|
||||
jump _main_menu
|
||||
jump _main_menu_screen
|
||||
|
||||
$ renpy.transition(config.exit_transition)
|
||||
|
||||
@@ -674,12 +682,6 @@ label _start:
|
||||
|
||||
$ renpy.block_rollback()
|
||||
|
||||
python hide:
|
||||
for i in range(0, 7):
|
||||
# renpy.music.stop(channel=i)
|
||||
# renpy.sound.stop(channel=i)
|
||||
pass
|
||||
|
||||
if config.main_menu_music:
|
||||
$ renpy.music.play(config.main_menu_music, if_changed=True)
|
||||
else:
|
||||
@@ -695,15 +697,19 @@ label _start:
|
||||
jump expression _restart[1]
|
||||
|
||||
label _invoke_main_menu:
|
||||
|
||||
$ renpy.call_in_new_context("_enter_main_menu")
|
||||
|
||||
if _restart:
|
||||
$ renpy.call_in_new_context(_restart[2])
|
||||
else:
|
||||
$ renpy.call_in_new_context("_main_menu")
|
||||
|
||||
|
||||
# If the main menu returns, then start the game.
|
||||
jump start
|
||||
|
||||
# At this point, we've been switched into a new context. So we
|
||||
# initialize it.
|
||||
label _enter_main_menu:
|
||||
label _main_menu(_main_menu_screen="_main_menu_screen"):
|
||||
|
||||
call _enter_menu from _call__enter_menu_1
|
||||
|
||||
@@ -713,9 +719,11 @@ label _enter_main_menu:
|
||||
|
||||
renpy.context().main_menu = True
|
||||
store.main_menu = True
|
||||
|
||||
jump expression _main_menu_screen
|
||||
|
||||
# This is called to show the main menu to the user.
|
||||
label _main_menu:
|
||||
label _main_menu_screen:
|
||||
|
||||
# Let the user completely override the main menu. (But please note
|
||||
# it still lives in the menu context, rather than the game context.)
|
||||
|
||||
@@ -29,6 +29,8 @@ init -1150 python:
|
||||
]
|
||||
|
||||
label _quit_prompt:
|
||||
$ renpy.loadsave.force_autosave()
|
||||
|
||||
if layout.yesno_prompt(None, u"Are you sure you want to quit?"):
|
||||
jump _quit
|
||||
else:
|
||||
|
||||
@@ -1,17 +1,29 @@
|
||||
# This file contains code that sets up the various mixers, based on how
|
||||
# the user sets config.has_music, .has_sound, and .has_voice.
|
||||
|
||||
init -1130:
|
||||
|
||||
init -1130 python hide:
|
||||
|
||||
# Set to true in the very unlikely event you want to manually init
|
||||
# the sound system.
|
||||
$ config.force_sound = False
|
||||
config.force_sound = False
|
||||
|
||||
# basics: True if the game will have music.
|
||||
$ config.has_music = True
|
||||
config.has_music = True
|
||||
|
||||
# basics: True if the game will have sound effects.
|
||||
$ config.has_sound = True
|
||||
config.has_sound = True
|
||||
|
||||
# Register 8 channels by default, for compatiblity with older version
|
||||
# of Ren'Py.
|
||||
for i in xrange(0, 8):
|
||||
renpy.music.register_channel(i)
|
||||
|
||||
renpy.music.register_channel("movie", "music", False, stop_on_mute=False)
|
||||
|
||||
# Set up default names for some of the channels.
|
||||
renpy.music.alias_channel(0, "sound")
|
||||
renpy.music.alias_channel(7, "music")
|
||||
renpy.music.alias_channel(2, "voice")
|
||||
|
||||
init 1130:
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ init -1100 python:
|
||||
return s
|
||||
|
||||
def nvl_show_core():
|
||||
|
||||
|
||||
if renpy.in_rollback():
|
||||
nvl_window = __s(style.nvl_window)['rollback']
|
||||
nvl_vbox = __s(style.nvl_vbox)['rollback']
|
||||
@@ -99,8 +99,14 @@ init -1100 python:
|
||||
rv = config.nvl_show_display_say(who, what, variant=nvl_variant, **kw)
|
||||
|
||||
ui.close()
|
||||
|
||||
renpy.shown_window()
|
||||
|
||||
return rv
|
||||
|
||||
def nvl_window():
|
||||
nvl_show_core()
|
||||
|
||||
def nvl_show(with_):
|
||||
nvl_show_core()
|
||||
renpy.with_statement(with_)
|
||||
@@ -208,7 +214,6 @@ init -1100 python:
|
||||
kind=adv)
|
||||
|
||||
def nvl_clear():
|
||||
|
||||
store.nvl_list = [ ]
|
||||
|
||||
# Run clear at the start of the game.
|
||||
@@ -219,6 +224,10 @@ init -1100 python:
|
||||
if nvl_list is None:
|
||||
store.nvl_list = [ ]
|
||||
|
||||
ui.layer("transient")
|
||||
ui.clear()
|
||||
ui.close()
|
||||
|
||||
ui.window(style=__s(style.nvl_window))
|
||||
ui.vbox(style=__s(style.nvl_vbox))
|
||||
|
||||
|
||||
@@ -164,7 +164,6 @@ python early hide:
|
||||
|
||||
renpy.music.queue(eval(p["file"]), channel=channel)
|
||||
|
||||
|
||||
renpy.statements.register('queue music',
|
||||
parse=parse_queue_music,
|
||||
execute=execute_queue_music,
|
||||
@@ -254,10 +253,131 @@ python early hide:
|
||||
parse=parse_stop_music,
|
||||
execute=execute_stop_sound)
|
||||
|
||||
|
||||
# Generic play/queue/stop statements. These take a channel name as
|
||||
# the second thing.
|
||||
|
||||
def parse_play_generic(l, parse_play_music=parse_play_music):
|
||||
channel = l.name()
|
||||
|
||||
if channel is None:
|
||||
renpy.error('play requires a channel')
|
||||
|
||||
rv = parse_play_music(l)
|
||||
if rv["channel"] is None:
|
||||
rv["channel"] = repr(channel)
|
||||
|
||||
return rv
|
||||
|
||||
def parse_queue_generic(l, parse_queue_music=parse_queue_music):
|
||||
channel = l.name()
|
||||
|
||||
if channel is None:
|
||||
renpy.error('queue requires a channel')
|
||||
|
||||
rv = parse_queue_music(l)
|
||||
if rv["channel"] is None:
|
||||
rv["channel"] = repr(channel)
|
||||
|
||||
return rv
|
||||
|
||||
def parse_stop_generic(l, parse_stop_music=parse_stop_music):
|
||||
channel = l.name()
|
||||
|
||||
if channel is None:
|
||||
renpy.error('stop requires a channel')
|
||||
|
||||
rv = parse_stop_music(l)
|
||||
if rv["channel"] is None:
|
||||
rv["channel"] = repr(channel)
|
||||
|
||||
return rv
|
||||
|
||||
def lint_play_generic(p, lint_play_music=lint_play_music):
|
||||
channel = eval(p["channel"])
|
||||
|
||||
if not renpy.music.channel_defined(channel):
|
||||
renpy.error("channel %r is not defined" % channel)
|
||||
|
||||
lint_play_music(p)
|
||||
|
||||
def lint_stop_generic(p):
|
||||
channel = eval(p["channel"])
|
||||
|
||||
if not renpy.music.channel_defined(channel):
|
||||
renpy.error("channel %r is not defined" % channel)
|
||||
|
||||
renpy.statements.register('play',
|
||||
parse=parse_play_generic,
|
||||
execute=execute_play_music,
|
||||
predict=predict_play_music,
|
||||
lint=lint_play_generic)
|
||||
|
||||
renpy.statements.register('queue',
|
||||
parse=parse_queue_generic,
|
||||
execute=execute_queue_music,
|
||||
lint=lint_play_generic)
|
||||
|
||||
renpy.statements.register('stop',
|
||||
parse=parse_stop_generic,
|
||||
execute=execute_stop_music,
|
||||
lint=lint_stop_generic)
|
||||
|
||||
|
||||
# The "window show" and "window hide" statements.
|
||||
def parse_window(l):
|
||||
p = l.simple_expression()
|
||||
if not l.eol():
|
||||
renpy.error('expected end of line')
|
||||
|
||||
return p
|
||||
|
||||
def lint_window(p):
|
||||
if p is not None:
|
||||
_try_eval(p, 'window transition')
|
||||
|
||||
def execute_window_show(p):
|
||||
if store._window:
|
||||
return
|
||||
|
||||
if p is not None:
|
||||
trans = eval(p)
|
||||
else:
|
||||
trans = config.window_show_transition
|
||||
|
||||
renpy.with_statement(None)
|
||||
store._window = True
|
||||
renpy.with_statement(trans)
|
||||
|
||||
def execute_window_hide(p):
|
||||
if not _window:
|
||||
return
|
||||
|
||||
if p is not None:
|
||||
trans = eval(p)
|
||||
else:
|
||||
trans = config.window_hide_transition
|
||||
|
||||
renpy.with_statement(None)
|
||||
store._window = False
|
||||
renpy.with_statement(trans)
|
||||
|
||||
renpy.statements.register('window show',
|
||||
parse=parse_window,
|
||||
execute=execute_window_show,
|
||||
lint=lint_window)
|
||||
|
||||
renpy.statements.register('window hide',
|
||||
parse=parse_window,
|
||||
execute=execute_window_hide,
|
||||
lint=lint_window)
|
||||
|
||||
|
||||
init -1200 python:
|
||||
|
||||
config.window_show_transition = None
|
||||
config.window_hide_transition = None
|
||||
|
||||
def _try_eval(e, what):
|
||||
try:
|
||||
return eval(e)
|
||||
|
||||
@@ -33,6 +33,7 @@ init -1200 python hide:
|
||||
style.image_placement = Style(style.default, help='default placement of images on the screen')
|
||||
style.image = Style(style.default, help="default style of images")
|
||||
|
||||
style.motion = Style(style.default, help="default style of motions and zooms.")
|
||||
style.animation = Style(style.default, help="default style of animations.")
|
||||
|
||||
style.say_label = Style(style.default, help='the name of the character speaking dialogue.')
|
||||
@@ -68,6 +69,7 @@ init -1200 python hide:
|
||||
style.hyperlink_text = Style(style.default, help='hyperlinked text')
|
||||
|
||||
style.viewport = Style(style.default, help='default style of viewports')
|
||||
style.transform = Style(style.motion, help='default style of transforms')
|
||||
|
||||
style.list = Style(style.default)
|
||||
style.list_box = Style(style.vbox)
|
||||
@@ -166,7 +168,8 @@ init -1090 python:
|
||||
style.default.ymaximum = None
|
||||
style.default.xoffset = 0
|
||||
style.default.yoffset = 0
|
||||
|
||||
style.default.subpixel = False
|
||||
|
||||
# Sound properties.
|
||||
style.default.sound = None
|
||||
|
||||
@@ -197,6 +200,10 @@ init -1090 python:
|
||||
style.hbox.box_layout = 'horizontal'
|
||||
style.vbox.box_layout = 'vertical'
|
||||
|
||||
# Motions, zooms, rotozooms, and transforms.
|
||||
style.motion.xanchor = 0
|
||||
style.motion.yanchor = 0
|
||||
|
||||
# Windows.
|
||||
style.window.background = Solid((0, 0, 0, 192))
|
||||
style.window.xpadding = 6
|
||||
@@ -263,6 +270,9 @@ init -1090 python:
|
||||
# Viewport
|
||||
style.viewport.clipping = True
|
||||
|
||||
# Transform
|
||||
style.transform.subpixel = True
|
||||
|
||||
# Menu windows.
|
||||
style.mm_root.background = "#000"
|
||||
style.mm_root.xfill = True
|
||||
|
||||
@@ -298,13 +298,19 @@ init -1110 python hide:
|
||||
|
||||
# Compat for the old roundrect theme.
|
||||
window = None,
|
||||
button_menu = True,
|
||||
button_menu = None,
|
||||
rounded_window = True,
|
||||
outline_bars = False,
|
||||
|
||||
mm_root = None,
|
||||
gm_root = None):
|
||||
|
||||
if button_menu is None:
|
||||
if (config.script_version is not None) and (config.script_version < (6, 9, 0)):
|
||||
button_menu = True
|
||||
else:
|
||||
button_menu = False
|
||||
|
||||
layout.defaults()
|
||||
|
||||
if config.screen_width <= 640:
|
||||
|
||||
@@ -52,7 +52,7 @@ init -1120:
|
||||
# This is called on each interaction, to ensure that the
|
||||
# appropriate voice file is played for the user.
|
||||
def voice_interact():
|
||||
|
||||
|
||||
if not config.has_voice:
|
||||
return
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ init python:
|
||||
|
||||
class _ImageMapper(object):
|
||||
|
||||
def __init__(self, ground, idle, hover, selected_idle, selected_hover, hotspots):
|
||||
def __init__(self, screen, ground, idle, hover, selected_idle, selected_hover, hotspots):
|
||||
|
||||
self.idle = idle
|
||||
self.hover = hover
|
||||
@@ -13,10 +13,29 @@ init python:
|
||||
for (x1, y1, x2, y2, name) in hotspots:
|
||||
self.hotspots[name] = (x1, y1, x2, y2)
|
||||
|
||||
# Display the layout navigation only if there are no
|
||||
# game menu buttons defined.
|
||||
for i in config.game_menu:
|
||||
if i[1] in self.hotspots:
|
||||
break
|
||||
else:
|
||||
layout.navigation(screen)
|
||||
|
||||
ui.fixed(style='imagemap')
|
||||
ui.image(ground)
|
||||
|
||||
# Display any navigation buttons that exist.
|
||||
for e in config.game_menu:
|
||||
screen_ = e[0]
|
||||
name = e[1]
|
||||
act = e[2]
|
||||
enable = e[3]
|
||||
|
||||
if not eval(enable):
|
||||
continue
|
||||
|
||||
self.button(name, act, screen == screen_)
|
||||
|
||||
def button(self, name, clicked, selected):
|
||||
|
||||
if name not in self.hotspots:
|
||||
@@ -32,8 +51,8 @@ init python:
|
||||
hover = self.selected_hover
|
||||
else:
|
||||
idle = self.idle
|
||||
hover = self.selected_hover
|
||||
|
||||
hover = self.hover
|
||||
|
||||
ui.imagebutton(
|
||||
LiveCrop((x1, y1, (x2 - x1), (y2 - y1)), idle),
|
||||
LiveCrop((x1, y1, (x2 - x1), (y2 - y1)), hover),
|
||||
|
||||
@@ -233,10 +233,8 @@ init python:
|
||||
|
||||
__scratch.file_picker_page = fpp
|
||||
|
||||
# Show navigation
|
||||
layout.navigation(screen)
|
||||
|
||||
ime = _ImageMapper(
|
||||
screen,
|
||||
config.load_save_ground,
|
||||
config.load_save_idle,
|
||||
config.load_save_hover,
|
||||
|
||||
@@ -44,9 +44,12 @@ label main_menu_screen:
|
||||
if isinstance(act, basestring):
|
||||
act = ui.jumpsoutofcontext(act)
|
||||
act()
|
||||
|
||||
break
|
||||
else:
|
||||
ui.jumpsoutofcontext(rv)()
|
||||
|
||||
|
||||
jump main_menu_screen
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -39,9 +39,8 @@ init python:
|
||||
|
||||
def __show_preferences():
|
||||
|
||||
layout.navigation("prefs")
|
||||
|
||||
ime = _ImageMapper(
|
||||
"prefs",
|
||||
config.preferences_ground,
|
||||
config.preferences_idle,
|
||||
config.preferences_hover,
|
||||
|
||||
@@ -17,9 +17,8 @@ init python hide:
|
||||
def yesno_prompt(screen, message):
|
||||
renpy.transition(config.intra_transition)
|
||||
|
||||
layout.navigation(screen)
|
||||
|
||||
ime = _ImageMapper(
|
||||
screen,
|
||||
config.yesno_prompt_ground,
|
||||
config.yesno_prompt_idle,
|
||||
config.yesno_prompt_hover,
|
||||
|
||||
@@ -6,6 +6,8 @@ init:
|
||||
image logo crop = im.Crop("logo.png", 0, 0, 100, 307)
|
||||
|
||||
image logo scale = im.Scale("logo.png", 100, 150)
|
||||
|
||||
image logo factorscale = im.FactorScale("logo.png", 1.5, 1.5)
|
||||
|
||||
image logo composite = im.Composite((200, 407),
|
||||
(0, 0), "logo.png",
|
||||
@@ -101,8 +103,13 @@ label demo_imageops:
|
||||
show logo scale at logopos
|
||||
with dissolve
|
||||
|
||||
e "The im.Scale operation lets us change the size of images."
|
||||
e "The im.Scale operation lets us scale an image to a particular size."
|
||||
|
||||
show logo factorscale at logopos
|
||||
with dissolve
|
||||
|
||||
e "im.FactorScale lets us do the same thing, except to a factor of the original size."
|
||||
|
||||
show logo green at logopos
|
||||
with dissolve
|
||||
|
||||
|
||||
@@ -223,6 +223,8 @@ label demo_minigame:
|
||||
|
||||
e "Now, why don't we play some pong?"
|
||||
|
||||
window hide None
|
||||
|
||||
label demo_minigame_pong:
|
||||
|
||||
# Put up the pong background, in the usual fashion.
|
||||
@@ -232,11 +234,13 @@ label demo_minigame_pong:
|
||||
python:
|
||||
ui.add(PongDisplayable())
|
||||
winner = ui.interact(suppress_overlay=True, suppress_underlay=True)
|
||||
|
||||
|
||||
scene bg washington
|
||||
show eileen vhappy
|
||||
|
||||
|
||||
window show None
|
||||
|
||||
|
||||
if winner == "eileen":
|
||||
|
||||
e "I win!"
|
||||
|
||||
@@ -62,6 +62,15 @@ label demo_movement:
|
||||
|
||||
e "Move can repeat a movement, and even have it bounce back and forth, like I'm doing now."
|
||||
|
||||
|
||||
show eileen happy at Move((.25, 1.0, 0.0, 1.0),
|
||||
(.75, 1.0, 1.0, 1.0),
|
||||
10.0, repeat=True, bounce=True, subpixel=True)
|
||||
|
||||
with dissolve
|
||||
|
||||
e "Our subpixel mode allows slow moves, of less than a few pixels a second, to be very accurate."
|
||||
|
||||
scene bg onememorial at Pan((0, 800), (0, 0), 10.0)
|
||||
with dissolve
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
# support. Right now, this is just showing off sound and music, but
|
||||
# Ren'Py does support movies, and we'll add them sometime later.
|
||||
|
||||
image movie = Movie(size=(320, 240), xpos=475, ypos=50, xanchor=0, yanchor=0)
|
||||
|
||||
label demo_multimedia:
|
||||
|
||||
@@ -22,18 +23,35 @@ label demo_multimedia:
|
||||
# This plays a sound effect.
|
||||
play sound "18005551212.ogg"
|
||||
|
||||
e "We can also play up to eight channels of sound effects on top of the music."
|
||||
e "We can play sound effects on top of the music."
|
||||
|
||||
$ renpy.music.set_pan(-1, 0)
|
||||
$ renpy.music.set_pan( 1, 2)
|
||||
|
||||
e "We can pan the music back and forth."
|
||||
|
||||
$ renpy.music.set_pan(0, .5)
|
||||
|
||||
e "Voice support is included as part of Ren'Py, although we don't yet have a demonstration."
|
||||
|
||||
e "We also support playing mpeg movies, but we don't have one to show you right now."
|
||||
|
||||
show eileen concerned
|
||||
|
||||
e "Sorry."
|
||||
|
||||
show eileen happy
|
||||
$ renpy.music.set_volume(0, .5)
|
||||
|
||||
e "Finally, we support playing movie files."
|
||||
|
||||
show movie behind eileen
|
||||
play movie "shuttle.ogv"
|
||||
|
||||
e "We can put a movie on the screen with text and other images."
|
||||
|
||||
stop movie
|
||||
hide movie
|
||||
|
||||
e "We can also play the movie in fullscreen... but with this tiny movie we're using as an example, it's going to look bad."
|
||||
|
||||
$ renpy.movie_cutscene("shuttle.ogv", stop_music=False)
|
||||
|
||||
$ renpy.music.set_volume(1, 1.0)
|
||||
|
||||
e "That's about it for multimedia."
|
||||
|
||||
return
|
||||
|
||||
@@ -10,6 +10,8 @@ init:
|
||||
|
||||
label demo_nvlmode:
|
||||
|
||||
window hide
|
||||
|
||||
nvl clear
|
||||
nvl show dissolve
|
||||
|
||||
@@ -72,6 +74,7 @@ label demo_nvlmode:
|
||||
$ menu = renpy.display_menu
|
||||
|
||||
nvl hide dissolve
|
||||
window show
|
||||
|
||||
return
|
||||
|
||||
|
||||
@@ -92,6 +92,8 @@ label demo_text:
|
||||
|
||||
eoutline "You can have more than one outline, and each has its own color and offset."
|
||||
|
||||
window hide
|
||||
|
||||
esubtitle "Here, we have two outlines around the white text."
|
||||
|
||||
esubtitle "The bottom one is a translucent black that's offset a little, while the top one is green."
|
||||
@@ -99,7 +101,9 @@ label demo_text:
|
||||
esubtitle "By hiding the window and adjusting the layout method, we are able to create reasonable subtitles."
|
||||
|
||||
esubtitle "This might be an interesting look for a game."
|
||||
|
||||
|
||||
window show
|
||||
|
||||
esfont "For even more control, Ren'Py supports SFonts, image files containing font information."
|
||||
|
||||
esfont "SFonts let you use fonts you otherwise couldn't, and apply special effects to fonts using your favorite image editor."
|
||||
|
||||
@@ -0,0 +1,223 @@
|
||||
# This is the code for the logo example.
|
||||
init python:
|
||||
|
||||
# This spins the logo, while at the same time zooming it and decreasing the
|
||||
# alpha.
|
||||
def logo_transform(t, st, at):
|
||||
|
||||
# Repeat every 10 seconds.
|
||||
st = st % 7.0
|
||||
|
||||
# The move takes 5 seconds.
|
||||
done = min(st / 5.0, 1.0)
|
||||
|
||||
t.xpos = done
|
||||
t.xanchor = 1.0 - done
|
||||
t.ypos = .5
|
||||
t.yanchor = .5
|
||||
t.rotate = 360 * done
|
||||
t.alpha = 1.0 - done
|
||||
t.zoom = 1.0 + done
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
# This is the code for the balls example. It's a bit complicated, but most of
|
||||
# this is the code for ball movement and so on. Only a very little bit of this
|
||||
# actually deals with Ren'Py.
|
||||
init python:
|
||||
import math
|
||||
|
||||
class Ball(object):
|
||||
def __init__(self, filename, x, y, function=None):
|
||||
|
||||
self.transform = Transform(child=filename, xpos=x, ypos=y, xanchor=0.5, yanchor=0.5, rotate=0, function=function)
|
||||
self.x = x
|
||||
self.y = y
|
||||
|
||||
MAX_SPEED = 150
|
||||
|
||||
self.dx = renpy.random.uniform(-MAX_SPEED, MAX_SPEED)
|
||||
self.dy = renpy.random.uniform(-MAX_SPEED, MAX_SPEED)
|
||||
|
||||
# Rotation speed.
|
||||
self.drotate = renpy.random.uniform(0, 180)
|
||||
|
||||
# This is called
|
||||
def balls_collide(p1, p2):
|
||||
"""
|
||||
Check to see if any of the balls are colliding. If they are,
|
||||
then handle the collision.
|
||||
"""
|
||||
|
||||
DOUBLE_RADIUS = 75
|
||||
|
||||
x21 = p2.x - p1.x
|
||||
y21 = p2.y - p1.y
|
||||
|
||||
d = math.hypot(x21, y21)
|
||||
|
||||
# Return if too far.
|
||||
if d > DOUBLE_RADIUS:
|
||||
return
|
||||
|
||||
vx21 = p2.dx - p1.dx
|
||||
vy21 = p2.dy - p1.dy
|
||||
|
||||
# Return if not approaching.
|
||||
if (vx21 * x21 + vy21 * y21) > 0:
|
||||
return
|
||||
|
||||
# Fix divide by zero.
|
||||
if x21 == 0:
|
||||
x21 = .00001
|
||||
|
||||
# Compute the collision.
|
||||
a = y21 / x21
|
||||
dvx2 = -(vx21 + a * vy21) / (1 + a * a)
|
||||
|
||||
p2.dx += dvx2
|
||||
p2.dy += a * dvx2
|
||||
|
||||
p1.dx -= dvx2
|
||||
p2.dy -= a * dvx2
|
||||
|
||||
# This is called by the first transform. It updates all of the
|
||||
# transforms.
|
||||
def balls_update(pilot, st, at):
|
||||
|
||||
global last_time
|
||||
|
||||
RADIUS = 75 / 2
|
||||
LEFT = RADIUS
|
||||
RIGHT = 800 - RADIUS
|
||||
TOP = RADIUS
|
||||
BOTTOM = 600 - RADIUS
|
||||
|
||||
# The pilot is the first ball in our list, and he's the one
|
||||
# that gets last_time updated.
|
||||
if last_time is None:
|
||||
dt = 0
|
||||
else:
|
||||
dt = st - last_time
|
||||
|
||||
last_time = st
|
||||
|
||||
# Handle current collisions.
|
||||
for i in xrange(0, len(balls)):
|
||||
for j in xrange(i + 1, len(balls)):
|
||||
balls_collide(balls[i], balls[j])
|
||||
|
||||
# Basic movement, and bouncing off the walls.
|
||||
for i in balls:
|
||||
|
||||
i.x += i.dx * dt
|
||||
i.y += i.dy * dt
|
||||
|
||||
if i.x < LEFT:
|
||||
i.x = LEFT
|
||||
i.dx = abs(i.dx)
|
||||
|
||||
if i.x > RIGHT:
|
||||
i.x = RIGHT
|
||||
i.dx = -abs(i.dx)
|
||||
|
||||
if i.y < TOP:
|
||||
i.y = TOP
|
||||
i.dy = abs(i.dy)
|
||||
|
||||
if i.y > BOTTOM:
|
||||
i.y = BOTTOM
|
||||
i.dy = -abs(i.dy)
|
||||
|
||||
|
||||
# Update the transforms.
|
||||
for i in balls:
|
||||
|
||||
# This is the code that deals with Ren'Py to update the
|
||||
# various transforms. Note that we use absolute coordinates
|
||||
# to position ourselves with subpixel accuracy.
|
||||
i.transform.xpos = absolute(i.x)
|
||||
i.transform.ypos = absolute(i.y)
|
||||
i.transform.rotate = (i.drotate * st) % 360.0
|
||||
i.transform.update()
|
||||
|
||||
return 0
|
||||
|
||||
# These are used in the button example:
|
||||
init python:
|
||||
def button_transform(t, st, at):
|
||||
t.rotate = (90 * st) % 360.0
|
||||
return 0
|
||||
|
||||
label demo_transform:
|
||||
|
||||
e "The Transform function allows you to rotate, zoom, move, and adjust the alpha of a displayable."
|
||||
|
||||
e "It does this under the control of a Python function, making it incredibly flexible at the cost of some complexity."
|
||||
|
||||
hide eileen
|
||||
with dissolve
|
||||
|
||||
show logo base at Transform(function=logo_transform)
|
||||
|
||||
e "Here's a simple example, showing how we can change an image as it moves around the screen."
|
||||
|
||||
e "A nice thing about Transform is that it's \"one price\"."
|
||||
|
||||
e "If you use it to do a rotation, you can zoom or adjust alpha at no additional cost."
|
||||
|
||||
hide logo base
|
||||
with dissolve
|
||||
|
||||
python:
|
||||
|
||||
last_time = None
|
||||
|
||||
# Define a list of ball objects.
|
||||
balls = [
|
||||
Ball("eileen_orb.png", 200, 150, function=balls_update),
|
||||
Ball("lucy_orb.png", 400, 150),
|
||||
Ball("eileen_orb.png", 600, 150),
|
||||
|
||||
Ball("lucy_orb.png", 200, 300),
|
||||
Ball("lucy_orb.png", 600, 300),
|
||||
|
||||
Ball("eileen_orb.png", 200, 450),
|
||||
Ball("lucy_orb.png", 400, 450),
|
||||
Ball("eileen_orb.png", 600, 450),
|
||||
]
|
||||
|
||||
# Add each ball's transform to the screen.
|
||||
for i, b in enumerate(balls):
|
||||
renpy.show("ball%d" % i, what=b.transform)
|
||||
|
||||
with dissolve
|
||||
|
||||
e "As the python functions get more complicated, more advanced behavior is possible."
|
||||
|
||||
e "This can include coordinating more than one Transform."
|
||||
|
||||
python:
|
||||
for i, b in enumerate(balls):
|
||||
renpy.hide("ball%d" % i)
|
||||
|
||||
|
||||
with dissolve
|
||||
|
||||
python hide:
|
||||
ui.transform(function=button_transform, xalign=0.5, yalign=0.5)
|
||||
ui.textbutton("A Working Button", clicked=ui.returns(True))
|
||||
|
||||
e "Finally, transforms can be applied to buttons, and work even while the button is zoomed."
|
||||
|
||||
show eileen happy
|
||||
with dissolve
|
||||
|
||||
e "With a little Python code, transforms let you do a lot of things."
|
||||
|
||||
|
||||
|
||||
return
|
||||
|
||||
|
||||
@@ -90,7 +90,9 @@ init:
|
||||
button(face, editing == i, ("edit", i), xminimum=250)
|
||||
|
||||
ui.null(height=20)
|
||||
ui.textbutton("Continue", clicked=ui.returns(("done", True)), xminimum=250)
|
||||
ui.textbutton("Continue",
|
||||
clicked=ui.returns(("done", True)),
|
||||
xminimum=250)
|
||||
ui.null(height=20)
|
||||
ui.close()
|
||||
|
||||
@@ -98,28 +100,30 @@ init:
|
||||
# Choice window.
|
||||
if editing:
|
||||
ui.frame(xpos=300,
|
||||
ypos=200,
|
||||
xanchor='left',
|
||||
yanchor='top',
|
||||
xfill=False,
|
||||
xminimum=500
|
||||
)
|
||||
ypos=200,
|
||||
xanchor='left',
|
||||
yanchor='top',
|
||||
xfill=False,
|
||||
xminimum=500,
|
||||
xmargin = 10
|
||||
)
|
||||
|
||||
ui.vbox()
|
||||
ui.text("What will you do in the %s?" % editing.lower())
|
||||
ui.null(height=20)
|
||||
|
||||
for i in choices:
|
||||
button(i, plan[editing] == i, ("set", i),
|
||||
xpos=0, xanchor='left')
|
||||
button(i,
|
||||
plan[editing] == i,
|
||||
("set", i),
|
||||
xpos=0,
|
||||
xanchor='left',
|
||||
xminimum=250)
|
||||
|
||||
ui.close()
|
||||
|
||||
# Window at the bottom.
|
||||
ui.window()
|
||||
ui.vbox()
|
||||
ui.text("To get to the next screen, click the 'Continue' button.")
|
||||
ui.close()
|
||||
e("To get to the next screen, click the 'Continue' button.", interact=False)
|
||||
|
||||
type, value = ui.interact()
|
||||
|
||||
@@ -199,6 +203,8 @@ label demo_ui:
|
||||
|
||||
e "Imagemaps let the user click on an image to make a choice. For example, the following screen lets you pick what to do after school:"
|
||||
|
||||
window hide None
|
||||
|
||||
# This is an imagemap. It consists of two images, and a list of
|
||||
# hotspots. For each hotspot we give the coordinates of the left,
|
||||
# top, right, and bottom sides, and the value to return if it is
|
||||
@@ -215,6 +221,8 @@ label demo_ui:
|
||||
# result variable. We can use an if statement to vary what
|
||||
# happens based on the user's choice.
|
||||
|
||||
window show None
|
||||
|
||||
if result == "swimming":
|
||||
|
||||
e "You chose swimming."
|
||||
@@ -242,6 +250,8 @@ label demo_ui:
|
||||
e "We also support viewports, that allow us to display things that are bigger then the screen."
|
||||
|
||||
e "This viewport can be adjusted by dragging, by the mouse wheel, and by the scrollbars."
|
||||
|
||||
window hide
|
||||
|
||||
show eileen happy at right
|
||||
with move
|
||||
@@ -262,15 +272,23 @@ label demo_ui:
|
||||
|
||||
show eileen happy at center
|
||||
with move
|
||||
|
||||
|
||||
window show
|
||||
|
||||
e "While these constructs are probably enough for most visual novels, dating simulations may be more complicated."
|
||||
|
||||
e "The ui functions allow you to create quite complicated interfaces."
|
||||
|
||||
e "For example, try the following scheduling and stats screen, which could be used by a stat-based dating simulation."
|
||||
|
||||
hide eileen
|
||||
with dissolve
|
||||
|
||||
$ day_planner()
|
||||
|
||||
show eileen happy
|
||||
with dissolve
|
||||
|
||||
e "For a better implementation of this, take a look at the dating sim engine (DSE) that ships with Ren'Py."
|
||||
|
||||
call fight("Eileen", 10, 99, pname=povname) from _call_fight_1
|
||||
|
||||
@@ -8,14 +8,14 @@ init:
|
||||
("demo_basics", "Basic Scripting", "5.6.3"),
|
||||
("demo_experience", "User Experience", "5.6.3"),
|
||||
("demo_transitions", "Transitions", "5.6.6"),
|
||||
("demo_movement", "Positions and Movement", "6.7.0"),
|
||||
("demo_movement", "Positions and Movement", "6.9.0"),
|
||||
("demo_animation", "Animation", "6.2.0"),
|
||||
("demo_multimedia", "Music and Sound", "5.6.3"),
|
||||
("demo_multimedia", "Music, Sound, and Video", "6.9.1"),
|
||||
("demo_imageops", "Image Operations", "6.5.0"),
|
||||
("demo_ui", "User Interaction", "6.5.0"),
|
||||
("demo_text", "Fonts and Text Tags", "6.8.0"),
|
||||
("demo_character", "Character Objects", "6.2.0"),
|
||||
("demo_advanced", "Advanced Features", "6.7.0"),
|
||||
("demo_advanced", "Advanced Features", "6.9.0"),
|
||||
]
|
||||
|
||||
# Update above with this!
|
||||
@@ -25,6 +25,7 @@ init:
|
||||
("demo_dynamic", "Dynamic Displayables", "5.6.3"),
|
||||
("demo_minigame", "Minigames", "6.3.2"),
|
||||
("demo_persistent", "Persistent Data", "6.7.0"),
|
||||
("demo_transform", "Transform", "6.9.0"),
|
||||
]
|
||||
|
||||
def demos_show(demos_info, nevermind):
|
||||
@@ -63,7 +64,7 @@ label demos:
|
||||
|
||||
# Is this the first time through the demo?
|
||||
$ demo_first_time = True
|
||||
|
||||
|
||||
show eileen happy at left
|
||||
with move
|
||||
|
||||
|
||||
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 11 KiB |
@@ -235,6 +235,12 @@ init -1 python hide:
|
||||
## Used when a game is loaded.
|
||||
config.after_load_transition = dissolve
|
||||
|
||||
## Used when the window is shown.
|
||||
config.window_show_transition = Dissolve(.25)
|
||||
|
||||
## Used when the window is hidden.
|
||||
config.window_hide_transition = Dissolve(.25)
|
||||
|
||||
#########################################
|
||||
## This is the name of the directory where the game's data is
|
||||
## stored. (It needs to be set early, before any other init code
|
||||
@@ -256,7 +262,9 @@ init -1 python hide:
|
||||
## The default text speed in characters per second. 0 is infinite.
|
||||
config.default_text_cps = 0
|
||||
|
||||
|
||||
config.window_icon = "logo.png"
|
||||
config.windows_icon = "logo32.png"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@ label start:
|
||||
|
||||
# Start the background music playing.
|
||||
play music "mozart.ogg"
|
||||
|
||||
window show
|
||||
|
||||
e "Hi, and welcome to the Ren'Py demo game."
|
||||
|
||||
@@ -47,6 +49,8 @@ label start:
|
||||
|
||||
e "We look forward to seeing what you can make with this! Good luck!"
|
||||
|
||||
window hide
|
||||
|
||||
# Returning from the top level quits the game.
|
||||
return
|
||||
|
||||
|
||||