I want to display linking line between objects in Map screen.
Sample Image is here : https://drive.google.com/file/d/1bgTzWK ... sp=sharing
And here's my screen and source code : https://drive.google.com/file/d/1geBs7z ... sp=sharing
Code: Select all
screen test_map(area, area_map, linked, footholds, char):
python:
area_name = area.area_name
char_pos_key = "base" + str(char.char_now_pos)
add area.area_img
frame:
text "Place = " + area_name
align (.5, .1)
for key, value in footholds.items():
add footholds[key][0] pos footholds[key][1]
add char.char_icon pos footholds[char_pos_key][1]
frame:
vbox:
label "Health"
bar value StaticValue(char.char_health, 100):
xmaximum 400
ymaximum 50
align (.05, .95)
frame:
textbutton "Back":
action Return()
align (.9, .9)
label test_label:
python:
test_ch_001 = StoryFactory.create("test")
test_ch_001.title = "Test Episode"
test_ch_001.label = "test_episode"
test_ch_001.seen = False
test_ch_001.lock = False
jump test_episode
return
label test_episode:
python:
base_001 = BaseFactory.create("1")
base_002 = BaseFactory.create("1")
base_003 = BaseFactory.create("1")
base_004 = BaseFactory.create("1")
base_005 = BaseFactory.create("1")
base_001.base_number = 1
base_002.base_number = 2
base_003.base_number = 3
base_004.base_number = 4
base_005.base_number = 5
base_001.base_name = "Test Base 1"
base_002.base_name = "Test Base 2"
base_003.base_name = "Test Base 3"
base_004.base_name = "Test Base 4"
base_005.base_name = "Test Base 5"
base_001.visit_count = 0
base_002.visit_count = 0
base_003.visit_count = 0
base_004.visit_count = 0
base_005.visit_count = 0
base_001.chapter = "test"
base_002.chapter = "test"
base_003.chapter = "test"
base_004.chapter = "test"
base_005.chapter = "test"
## This dict is what I've seen in path finder algorithm.
## Can I solve it with this approach?
base_linked = {
'base_001' : ( 'base_002'),
'base_002' : ( 'base_001', 'base_003', 'base_004' ),
'base_003' : ( 'base_002', 'base_004' ),
'base_004' : ( 'base_002', 'base_004', 'base_005' ),
'base_005' : ( 'base_004' )
}
def test_solid_maker(color, x, y):
return Solid(color, xsize=x, ysize=y)
f1 = test_solid_maker("#000", 100, 100)
f2 = test_solid_maker("#000", 100, 100)
f3 = test_solid_maker("#000", 100, 100)
f4 = test_solid_maker("#000", 100, 100)
f5 = test_solid_maker("#000", 100, 100)
footholds = {
"base1" : ( f1, (346, 768) ),
"base2" : ( f2, (1346, 768) ),
"base3" : ( f3, (848, 501) ),
"base4" : ( f4, (284, 113) ),
"base5" : ( f5, (1346, 119) )
}
map_001 = MapFactory.create("1")
area_map = [ base_001, base_002, base_003, base_004, base_005 ]
map_001.area_number = 1
map_001.area_name = "Test Area"
map_001.area_bases = ( base_001, base_002, base_003, base_004, base_005 )
map_001.area_img = "test/test_bg.jpg"
char_001 = CharacterFactory().create("1")
char_001.char_name = "Test Character"
char_001.char_icon = "test/char_icon.png"
char_001.char_pre_pos = None
char_001.char_now_pos = 2
char_001.char_health = 100
e "Instances were created."
e "Run Developer Console and check them."
call show_screen_test
e "Now you go back to main menu"
python:
test_ch_001.seen = True
return
label show_screen_test:
call screen test_map(map_001, area_map, base_linked, footholds, char_001)
return
Now, I don't know how to display linking lines, which can be shown in sample image.
I think I can solve it with CDD, but actually I don't understand what CDD is and how to use it. Even I've read documentation.
Can you tell me how to solve it?
Thanks.