Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
mycard
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
syntax_j
mycard
Commits
f554109f
Commit
f554109f
authored
Nov 18, 2011
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Input临时
parent
9654c7e6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
1 deletion
+32
-1
lib/scene_title.rb
lib/scene_title.rb
+8
-0
lib/widget_inputbox.rb
lib/widget_inputbox.rb
+23
-0
lib/window_action.rb
lib/window_action.rb
+1
-1
No files found.
lib/scene_title.rb
View file @
f554109f
...
...
@@ -6,7 +6,9 @@
#==============================================================================
class
Scene_Title
<
Scene
require_relative
'window_title'
require_relative
'widget_inputbox'
def
start
title
=
Dir
.
glob
(
"graphics/titles/title_*.*"
)
title
=
title
[
rand
(
title
.
size
)]
@background
=
Surface
.
load
(
title
)
...
...
@@ -33,11 +35,17 @@ class Scene_Title < Scene
@command_window
.
index
=
nil
end
when
Event
::
MouseButtonDown
case
event
.
button
when
Mouse
::
BUTTON_LEFT
Widget_InputBox
.
show
(
0
,
0
){
|
text
,
finished
|
p
text
,
finished
}
if
@command_window
.
include?
(
event
.
x
,
event
.
y
)
@command_window
.
click
((
event
.
y
-
@command_window
.
y
)
/
@command_window
.
class
::
Button_Height
)
end
when
Mouse
::
BUTTON_RIGHT
Widget_InputBox
.
right
when
4
#scrool_up
@command_window
.
index
=
@index
?
(
@index
-
1
)
%
Buttons
.
size
:
0
when
5
...
...
lib/widget_inputbox.rb
0 → 100644
View file @
f554109f
class
Widget_InputBox
require
'tk'
@@root
=
TkRoot
.
new
{
withdraw
overrideredirect
true
attributes
:topmost
,
true
}
@@entry
=
TkEntry
.
new
(
@@root
){
takefocus
1
validate
:focusout
validatecommand
{
@@root
.
withdraw
;
@@proc
.
call
(
get
,
false
);
true
}
bind
(
'Key-Return'
){
@@root
.
withdraw
;
@@proc
.
call
(
get
,
true
);
true
}
pack
}
def
self
.
show
(
x
,
y
,
text
=
nil
,
&
proc
)
@@root
.
geometry
"+
#{
x
+
TkWinfo
.
pointerx
(
@@root
)
-
Mouse
.
state
[
0
]
}
+
#{
y
+
TkWinfo
.
pointery
(
@@root
)
-
Mouse
.
state
[
1
]
}
"
@@root
.
deiconify
@@entry
.
text
text
if
text
@@proc
=
proc
@@entry
.
focus
:force
end
Thread
.
new
{
Tk
.
mainloop
}
end
lib/window_action.rb
View file @
f554109f
...
...
@@ -57,4 +57,4 @@ class Window_Action < Window_List
end
def
lostfocus
end
end
end
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment