hey i tried to do this but it still won't work
Author |
Message |
alflex
|
Posted: Tue Feb 22, 2005 3:04 pm Post subject: hey i tried to do this but it still won't work |
|
|
hey i'm trying to make picture buttons b/c i'm trying to make paint and all the other buttons work but the white one won't work i think it is b/c it is thinking that it is a background and i've tried to make a white box and import it in but it still won't work do u think u guys can give me a hand
thnx
%_%_%_%_%_%_%_%_%_%_%_%_%_%_%_%_%_%_%_%_
import GUI in "%oot/lib/GUI"
View.Set ("graphics:max;max,nobuttonbar")
const size : int := 65 % The buttons size.
var redbutton, redpic : int
var bluebutton, bluepic : int
var greenbutton, greenpic : int
var brbutton, brpic : int
var blackbutton, blackpic : int
var whitebutton, whitepic : int
var yellowbutton, yellowpic : int
var purplebutton, purplepic : int
procedure redpressed
put "red"
end redpressed
procedure bluepressed
put "blue"
end bluepressed
procedure greenpressed
put "green"
end greenpressed
procedure brpressed
put "brightred"
end brpressed
procedure blackpressed
put "black"
end blackpressed
procedure whitepressed
put "white"
end whitepressed
procedure yellowpressed
put "yellow"
end yellowpressed
procedure purplepressed
put "purple"
end purplepressed
Draw.FillBox (0, 0, 10, 10, red)
redpic := Pic.New (1, 0, 9, 9)
Draw.FillBox (0, 0, 10, 10, blue)
bluepic := Pic.New (1, 0, 9, 9)
Draw.FillBox (0, 0, 10, 10, green)
greenpic := Pic.New (1, 0, 9, 9)
Draw.FillBox (0, 0, 10, 10, brightred)
brpic := Pic.New (1, 0, 9, 9)
Draw.FillBox (0, 0, 10, 10, black)
blackpic := Pic.New (1, 0, 9, 9)
Draw.FillBox (0, 0, 10, 10, white)
whitepic := Pic.New (1, 0, 9, 9)
Draw.FillBox (0, 0, 10, 10, yellow)
yellowpic := Pic.New (1, 0, 9, 9)
Draw.FillBox (0, 0, 10, 10, purple)
purplepic := Pic.New (1, 0, 9, 9)
cls
% Create the picture buttons.
redbutton := GUI.CreatePictureButton (70, 20, redpic, redpressed)
bluebutton := GUI.CreatePictureButton (84, 20, bluepic, bluepressed)
greenbutton := GUI.CreatePictureButton (98, 20, greenpic, greenpressed)
brbutton := GUI.CreatePictureButton (112, 20, brpic, brpressed)
blackbutton := GUI.CreatePictureButton (126, 20, blackpic, blackpressed)
whitebutton := GUI.CreatePictureButton (140, 20, whitepic, whitepressed)
yellowbutton := GUI.CreatePictureButton (154, 20, yellowpic, yellowpressed)
purplebutton := GUI.CreatePictureButton (168, 20, purplepic, purplepressed)
loop
exit when GUI.ProcessEvent
end loop |
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
xHoly-Divinity
|
Posted: Tue Feb 22, 2005 4:04 pm Post subject: (No subject) |
|
|
Please use quote tags when submitting source code. In response to your question, you make a very good point. I'm not exactly sure why it doesn't show. I know that it is not because of the background, because i made it black, and it still won't show. Try making just a plain button, then drawing a white box over top of it, that might do the trick. |
|
|
|
|
 |
jamonathin

|
Posted: Tue Feb 22, 2005 6:13 pm Post subject: (No subject) |
|
|
The reason the white box wont show up is because it is being merged with the grey background on the button ( same concept as using picMerge ). I suggest using a very light grey.
Here's a quick way to find color numbers:
code: |
colorback(black)
cls
for i : 1 .. maxcolor
color (i)
put i, " " ..
end for
| [/code] |
|
|
|
|
 |
jamonathin

|
Posted: Tue Feb 22, 2005 6:13 pm Post subject: (No subject) |
|
|
The reason the white box wont show up is because it is being merged with the grey background on the button ( same concept as using picMerge ). I suggest using a very light grey.
Here's a quick way to find color numbers:
code: |
colorback(black)
cls
for i : 1 .. maxcolor
color (i)
put i, " " ..
end for
|
|
|
|
|
|
 |
cool dude

|
Posted: Tue Feb 22, 2005 6:24 pm Post subject: (No subject) |
|
|
two things firstly "jamonathin" there's no need to post twice. secondly wat white box r u talkin about because when i press it, it works and says white |
|
|
|
|
 |
jamonathin

|
Posted: Tue Feb 22, 2005 6:28 pm Post subject: (No subject) |
|
|
Yeah sorry, my dad's comp is real crappy, and i don't know how it did it twice, but what he ment was the white box on the actual button, not the text. |
|
|
|
|
 |
cool dude

|
Posted: Tue Feb 22, 2005 6:37 pm Post subject: (No subject) |
|
|
u mean when u click the white/grey box beside all the other boxes and it's supposed to say white, because that works. i don't see any other white box. |
|
|
|
|
 |
jamonathin

|
Posted: Tue Feb 22, 2005 6:41 pm Post subject: (No subject) |
|
|
He's trying to create a white box on the actually button (like the other boxes), and it wont show up, it's just a plain ol' grey box. |
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
cool dude

|
Posted: Tue Feb 22, 2005 7:01 pm Post subject: (No subject) |
|
|
k i understand now! i really hate using the built in GUI and i would rather do the GUI myself with no problems. i suggest changing it to your own GUI because i never use the built in one so i won't be able to help u much. if u need any help making the GUI yourself it's really easy and i will definetly help u. |
|
|
|
|
 |
Bacchus

|
Posted: Tue Feb 22, 2005 10:50 pm Post subject: (No subject) |
|
|
if the problem is the color merging, try changing the Picture Transparent color to something other than default (white) lookup the command in f10 under Pic. |
|
|
|
|
 |
person
|
Posted: Wed Feb 23, 2005 6:28 pm Post subject: (No subject) |
|
|
if in all desperation ur attempts fail, u can always use a colour close to white such as 30 |
|
|
|
|
 |
|
|