Hello,
I am looking for sample code with login form, with background picture. Later I will connect it to MySql database.
Please can any one provide me simple Python code ?
Thank you in advance
Hello,
I am looking for sample code with login form, with background picture. Later I will connect it to MySql database.
Please can any one provide me simple Python code ?
Thank you in advance
while it might not be quite as “simple” as you whished for. it’s still working. it’s a bit blown up due to popup-messages and cleanups etc.
http://thomaseg1.p3dp.com/samples/Tut-DirectGUI.zip
might help you to get started. it’s the file named blablabla-3.py
Thank you a lot
One more question.
How can I resize the picture full screen ?
self.bgframe = DirectFrame(
frameColor=(0,0,0,0),
frameSize=(-1,1,-1,1),geom=loader.loadModel("./models/login-bg.egg"),geom_pos=(0,0.0001,0),sortOrder=1)
login-bg.egg :
{
“egg-texture-cards -p 384,384 -o myImage2.egg loginbg.jpg”
}
loginbg {
loginbg.jpg
}
{
vpool {
0 {
-1.33333 1 0
{ 0 1 }
}
1 {
-1.33333 -1 0
{ 0 0 }
}
2 {
1.33333 -1 0
{ 1 0 }
}
3 {
1.33333 1 0
{ 1 1 }
}
}
loginbg {
{
{ 1 1 1 1 }
{ loginbg }
{ 0 1 2 3 { vpool } }
}
}
}
Please be kind to help me to solve this issue too. I am just learning , how this stuff works:
I want to add the following function
def clearText():
unEntry.enterText(’’)
self.unEntry = DirectEntry( initialText=("Username"),[b]focusInCommand=clearText()[/b],
scale=0.05,
text_scale=(1,1),
pos=(-.56,0,-0.57),
frameColor=(1,1,1,0.1))
But I am not lucky with this
Thanks
in the comment part of the egg you see
"egg-texture-cards -p 384,384 -o myImage2.egg loginbg.jpg"
that’s the command which was used to create the card. the 384 value is half the window-height ( in my case 768).
there are many other ways to get fullscreen quads. like the cardmaker, or textured dgui frames. it’s all in the manual
for the focusInCommand. if you do cleartextb[/b] you’ll call the function right now and pass the function’s return value. to fix it simply remove the () part.
Thanks for reply again. Can you please give me example how to use DirectLabel? I want to add text Username and Password in login input form .
sorry i never used directlabels. you might want to check out the manual page about it.