• Anmelden

1

Sonntag, 27. Mai 2007, 19:42

Item gate

hi ioch hät gern so was:

wenn ich es rufe kommt dieses Fenster.
wärend dieses Fensters kann man nicht ins Menu, aber mit Esc beenden.
man soll mit den pfeiltasten items auswählen dürfen.(dessen farbe soll dan grau werden.)
wenn man aus gewäht kat kann man auf Ok klicken.
wenn das was man ausgewäht hat mit items aud dem Aufruf übereinstimmt, soll der Schalter mit der id in Aufruf an gehn.

CODE:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
Width=200
Keyitems=[1,2,3,4,5,6,7,8,9]
#-------------------------------
class Window_Schloss_text  < Window_Base
  def initialize(titel)
    super(200, 144, Width,154)
    self.opacity = 0   
    self.contents = Bitmap.new(width-32, height-32)
    self.contents.draw_text(0,0,width-32,32,titel,1)
    self.contents.draw_text(0,height-69,width-32,32,'ok',1)
    @data=[]
    for i in 0...Keyitems.size
      #hier wird geprüft was angezeigt wird.
      if $game_party.item_number(Keyitems[i])!=0
        @data << $data_items[Keyitems[i]]
      end
    end
    for i in 0...@data.size
      bitmap = RPG::Cache.icon(@data[i].icon_name)
      self.contents.blt((width-32)/2-12*@data.size+i*24,45,bitmap,Rect.new(0,0,24,24)) 
    end
  end  
end
#-------------------------------
class Window_Schloss_titel  < Window_Base
  def initialize
    super(200, 160, Width,32)
    self.back_opacity = 180
  end    
end
#-------------------------------
class Window_Schloss_Items  < Window_Base
  def initialize(id,items)
    super(200, 192, Width,48)
    self.back_opacity = 180        
  end 
end
#-------------------------------
class Window_Schloss_ok  < Window_Base
  def initialize
    super(200, 240, Width,40)
    self.back_opacity = 180
  end    
end
#-------------------------------
class Scene_Schloss
  def initialize(id,items,titel='Schloss')
    @window_st = Window_Schloss_titel.new
    @window_si = Window_Schloss_Items.new(id,items)
    @window_so = Window_Schloss_ok.new
    @windoe_st2 = Window_Schloss_text.new(titel)
  end
 
  def main
    Audio.me_stop
    Audio.bgs_stop
    # Execute transition
 
    @spriteset = Spriteset_Map.new
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    @window_st.dispose
    @window_si.dispose
    @window_so.dispose
    @windoe_st2.dispose
  end
 
  def update
    @window_st.update
    @window_si.update
    @window_so.update
    @windoe_st2.update
        #hier dann die Tastatur- oder Aktivitätsabfrage
    if  Input.trigger?(Input::B)
      $scene = Scene_Map.new
    end
 
  end
end


hofe auf hilfe.
Realität ist nur eine subjektive Wahrnehmungsstörung.

Alles ist wahr, wenn man für wahr einen bestimmten Wert annimmt.

2

Montag, 28. Mai 2007, 12:22

schreib am besten ne pn an monsta.
der wird dein proplem schnell lösen.
:jagen:

3

Montag, 28. Mai 2007, 12:29

ok ich versuchs.
Realität ist nur eine subjektive Wahrnehmungsstörung.

Alles ist wahr, wenn man für wahr einen bestimmten Wert annimmt.

4

Dienstag, 5. Juni 2007, 11:58

@Hanmac
probier mal das

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#==============================================================================
# ** Scene_Item
#------------------------------------------------------------------------------
#  This class performs item screen processing.
#==============================================================================
 
class Scene_Schloss
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     menu_index : command cursor's initial position
  #--------------------------------------------------------------------------
  def initialize(keys,switch=1)
    @keys= keys
    @switch = switch
  end
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Make help window, item window
    @help_window = Window_Help.new
    @item_window = Window_Item.new
    # Associate help window
    @item_window.help_window = @help_window
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @help_window.dispose
    @item_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update windows
    @help_window.update
    @item_window.update
    # If item window is active: call update_item
    update_item
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when item window is active)
  #--------------------------------------------------------------------------
  def update_item
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to menu screen
      $scene = Scene_Map.new
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Get currently selected data on the item window
      @item = @item_window.item
      # If not a use item
      unless @item.is_a?(RPG::Item)
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      #bestimmes item?
      if @keys.include?(@item.id)
        #item verlieren
        $game_party.lose_item(@item.id, 1)
        #schalter aktivieren
        $game_switches[@switch] = true
        #enter spielen
        $game_system.se_play($data_system.decision_se)
        #szene verlassen
        # Switch to menu screen
        $scene = Scene_Map.new
        return
      end
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
    end
  end
end


Aufruf:

Quellcode

1
2
$scene = Scene_Schloss.new([1,3,2],1)
$scene = Scene_Schloss.new(auslösende Items,switch)


@Rikimaru
Hör auf hier rumzuspammen. Wirklich sinnvoll war der Hinweis auch nicht, besonders da Monsta keine PNs mag. 1 Punkt für dich

- Sven
:information: YAams
:rainbow: Random Signatur
Bild





Weitere Informationen | Download
Mit Support für RGSS Project 1!
Bild

5

Dienstag, 5. Juni 2007, 12:09

es ist zwar von der Form nichtdas was ich wolt, aber den code kann ich nutzen.
vielen vielen Dank^^
Realität ist nur eine subjektive Wahrnehmungsstörung.

Alles ist wahr, wenn man für wahr einen bestimmten Wert annimmt.

Social Bookmarks