找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 15183|回复: 3

[已解决] 这是为什么呢?

[复制链接]
发表于 2019-12-28 22:47:35 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
[RenPy] 纯文本查看 复制代码
#初始变量

init python:
    title = "1"
    intro = "2"
    more = "3"

#图片库

    place = "IMG_8738.JPG"
    if title == "春生中学":
        place = "school_rain.JPG"
    else:
        place = "city_rain.JPG"

image school_image:
    contains:
        im.Blur("piece/mid1.png", 4.5)
    contains:
        im.Blur("piece/mid1.png", 3.0)
    contains:
        im.Blur("piece/mid1.png", 1.5)
    contains:
        "piece/mid1.png"
image citybac_image:
    contains:
        im.Blur("city_rain.JPG",3.0)
#主页面定义
screen mapst():
    zorder 1

    add place xalign 0.5 yalign 0.5 size(750*2/3,500*2/3)
    frame:
        xalign 0.5 yalign 0.5
        xsize 750*2/3
        ysize 500*2/3
    add "bgmenu.png"
    frame:
        xalign 0.0
        yalign 1.0
        xsize 250
        ysize 720
        xmargin .05
        ymargin .05
        xpadding .15
        ypadding .15

        hbox:
            image intro size 18 xalign 0.5 yalign 0.5
            $ more = " "
            image more size 15 xalign 0.5 yalign 0.5
            spacing 5
    frame:
        xalign 0.0  #放在右上角
        yalign 0.0
        xsize 100
        ysize 80
        xmargin .05   #和其他元素间留点儿距离
        ymargin .05
        xpadding .15  #和内部内容留点儿距离
        ypadding .15

        vbox:  #放一个竖向排版的盒子。
            image title size 20 xalign 0.0 yalign 0.0

    #imagemap:

    #    idle school_image
    #    hover "city_rain.JPG"
    #    ground "city_rain.JPG"

        #hotspot (, , ,) action Show(schoolgrid, transition = dissolve)

#学校界面
screen schoolgid():
    zorder 50
    add citybac_image
    add school_image
    fixed:

        vbox:
            frame:
                align (0.0,0.0)
                textbutton "{size=18}返{/size}" xalign 0.5 yalign 0.5  xysize(25, 25) action Hide("schoolgid"),Show("map")

        vbox:
            frame:
                align (1.0,0.0)
                textbutton "{size=18}進{/size}" xalign 0.5 yalign 0.5  xysize(25, 25) action Hide("schoolgid"),Show("schoolscr")

screen scholscr():




label beginmap:
    window hide

    call screen mapst with dissolve nopredict
    show screen calendar()
    show screen weather()


大佬好,我又出错了,
不知道有没有眼熟我的

```
I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/screensmap beforetest.rpy", line 195, in script
    call screen mapst with dissolve nopredict
  File "renpy/common/000statements.rpy", line 531, in execute_call_screen
    store._return = renpy.call_screen(name, *args, **kwargs)
TypeError: 'int' object is not iterable

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "game/screensmap beforetest.rpy", line 195, in script
    call screen mapst with dissolve nopredict
  File "C:\Users\Air\Downloads\renpy-7.3.2-sdk\renpy\ast.py", line 1947, in execute
    self.call("execute")
  File "C:\Users\Air\Downloads\renpy-7.3.2-sdk\renpy\ast.py", line 1935, in call
    return renpy.statements.call(method, parsed, *args, **kwargs)
  File "C:\Users\Air\Downloads\renpy-7.3.2-sdk\renpy\statements.py", line 277, in call
    return method(parsed, *args, **kwargs)
  File "renpy/common/000statements.rpy", line 531, in execute_call_screen
    store._return = renpy.call_screen(name, *args, **kwargs)
  File "C:\Users\Air\Downloads\renpy-7.3.2-sdk\renpy\exports.py", line 2896, in call_screen
    rv = renpy.ui.interact(mouse="screen", type="screen", roll_forward=roll_forward)
  File "C:\Users\Air\Downloads\renpy-7.3.2-sdk\renpy\ui.py", line 295, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "C:\Users\Air\Downloads\renpy-7.3.2-sdk\renpy\display\core.py", line 2699, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
  File "C:\Users\Air\Downloads\renpy-7.3.2-sdk\renpy\display\core.py", line 3191, in interact_core
    self.draw_screen(root_widget, fullscreen_video, (not fullscreen_video) or video_frame_drawn)
  File "C:\Users\Air\Downloads\renpy-7.3.2-sdk\renpy\display\core.py", line 2091, in draw_screen
    renpy.config.screen_height,
  File "render.pyx", line 546, in renpy.display.render.render_screen
  File "render.pyx", line 247, in renpy.display.render.render
  File "C:\Users\Air\Downloads\renpy-7.3.2-sdk\renpy\display\layout.py", line 722, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 154, in renpy.display.render.render
  File "render.pyx", line 247, in renpy.display.render.render
  File "C:\Users\Air\Downloads\renpy-7.3.2-sdk\renpy\display\layout.py", line 722, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 154, in renpy.display.render.render
  File "render.pyx", line 247, in renpy.display.render.render
  File "C:\Users\Air\Downloads\renpy-7.3.2-sdk\renpy\display\layout.py", line 722, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 154, in renpy.display.render.render
  File "render.pyx", line 247, in renpy.display.render.render
  File "C:\Users\Air\Downloads\renpy-7.3.2-sdk\renpy\display\screen.py", line 675, in render
    child = renpy.display.render.render(self.child, w, h, st, at)
  File "render.pyx", line 154, in renpy.display.render.render
  File "render.pyx", line 247, in renpy.display.render.render
  File "C:\Users\Air\Downloads\renpy-7.3.2-sdk\renpy\display\layout.py", line 722, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 154, in renpy.display.render.render
  File "render.pyx", line 247, in renpy.display.render.render
  File "C:\Users\Air\Downloads\renpy-7.3.2-sdk\renpy\display\layout.py", line 1127, in render
    st, at)
  File "render.pyx", line 154, in renpy.display.render.render
  File "render.pyx", line 247, in renpy.display.render.render
  File "C:\Users\Air\Downloads\renpy-7.3.2-sdk\renpy\display\layout.py", line 883, in render
    surf = render(d, rw, height - y, cst, cat)
  File "render.pyx", line 154, in renpy.display.render.render
  File "render.pyx", line 247, in renpy.display.render.render
  File "accelerator.pyx", line 108, in renpy.display.accelerator.transform_render
TypeError: 'int' object is not iterable
这是为什么呢......
我停止了思考



发表于 2019-12-29 13:23:01 | 显示全部楼层
写的。。。
。。。
call screen 后面 show screen 还怎么显示?还with?
条件判断中文字符还行。
add 添加的是可视组件。
别忘了,在python里定义的变量,到renpy里变量名要加【store.】
见此:https://doc.renpy.cn/zh-CN/pytho ... #names-in-the-store
回复 支持 抱歉

使用道具 举报

 楼主| 发表于 2019-12-29 15:22:52 来自手机 | 显示全部楼层
龙氏 发表于 2019-12-29 13:23
写的。。。
。。。
call screen 后面 show screen 还怎么显示?还with?

谢谢
回复 支持 抱歉

使用道具 举报

 楼主| 发表于 2019-12-29 16:28:26 来自手机 | 显示全部楼层
龙氏 发表于 2019-12-29 13:23
写的。。。
。。。
call screen 后面 show screen 还怎么显示?还with?

那个,条件判断不可以是字符串么
回复 支持 抱歉

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|RenPy中文空间 ( 苏ICP备17067825号|苏公网安备 32092302000068号 )

GMT+8, 2024-11-23 12:03 , Processed in 0.115014 second(s), 29 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表