Benvenuto Visitatore(Log In|Registrati)
8 Feb 2015, 20:42
Messaggio
#1
|
|
Gruppo: Gamer Messaggi: 42 Iscritto il: 3 February 15 Da: Lecce, Italy Utente Nr.: 20.669 BGE Psychic detective Playing Phantasmagoria SO Windows7 |
Ciao Ragazzi,
Sono nuovo nel forum è vorrei poter chiedere un opinione riguardo un problema che sto avendo.. Cerco in tempo reale di disegnare un orologio sulla mia room tramite il comando DrawLines. Va tutto alla grande tranne il fatto che quando cerco di inizializzare il disegno il gioco interno incomincia ad andare a rilento... Come se si stesse sforzando tantissimo a fare questa operazione... La eseguo tramite repeatedly_execute_always() Dato che dovrebbe disegnare le linee ad ogni frame al secondo... Qualcuno potrebbe darmi una mano ? Grazie in anticipo ragazzi. CODICE DynamicSprite*backgroundCopy;
function DrawClock(this Object*, int centrex, int centrey, int radius) { DrawingSurface *ds = Room.GetDrawingSurfaceForBackground(); backgroundCopy = DynamicSprite.CreateFromBackground(0); ds.Clear(); ds.DrawImage(0, 0, backgroundCopy.Graphic); DateTime *dt = DateTime.Now; int gametimeh = dt.Hour; int gametimem = dt.Minute; int gametimes = dt.Second; //clock position and size ds.DrawingColor = 15; //white ds.DrawCircle(centrex, centrey, radius); ds.DrawingColor = 0; //black ds.DrawCircle(centrex, centrey, radius-1); ds.DrawingColor = 15; //white ds.DrawLine(centrex, centrey, centrex+FloatToInt(0.6*IntToFloat(radius)*Maths.Sin(Maths.DegreesToRadians(IntToFloat(gametimeh)*30.0)), eRoundNearest), centrey-FloatToInt(0.6*IntToFloat(radius)*Maths.Cos(Maths.DegreesToRadians(IntToFloat(gametimeh)*30.0)), eRoundNearest), 3); ds.DrawLine(centrex, centrey, centrex+FloatToInt(0.9*IntToFloat(radius)*Maths.Sin(Maths.DegreesToRadians(IntToFloat(gametimem)*6.0)), eRoundNearest), centrey-FloatToInt(0.9*IntToFloat(radius)*Maths.Cos(Maths.DegreesToRadians(IntToFloat(gametimem)*6.0)), eRoundNearest), 2); ds.DrawLine(centrex, centrey, centrex+FloatToInt(0.9*IntToFloat(radius)*Maths.Sin(Maths.DegreesToRadians(IntToFloat(gametimes)*6.0)), eRoundNearest), centrey-FloatToInt(0.9*IntToFloat(radius)*Maths.Cos(Maths.DegreesToRadians(IntToFloat(gametimes)*6.0)), eRoundNearest), 1); ds.Release(); this.Graphic = backgroundCopy.Graphic; backgroundCopy.Delete(); } -------------------- |
|
|
|
Vincent Disegnare un orologio 8 Feb 2015, 20:42
AprilSkies CIAO VINCENT!!!! \o/
Che bell... 8 Feb 2015, 21:28
Vincent GRANDISSIMO APRILSKIES !!!
SONO FELI... 8 Feb 2015, 21:58
Vincent Ciao AprilSkies,
Ho provato il metodo che hai pen... 8 Feb 2015, 22:41
AprilSkies Infatti non avevo testato XD
Forse puoi provare a... 8 Feb 2015, 22:56
Vincent Si... effettivamente il gioco continua sempre a ra... 8 Feb 2015, 23:20
Vincent Siiiiiiii ha funzionato alla grandeeeeee
Feli... 8 Feb 2015, 23:52
AprilSkies Perfetto!
Sì in generale il consiglio è di di... 9 Feb 2015, 08:44
Vincent Si infatti, hai perfettamente ragione.
Volendo si ... 9 Feb 2015, 13:07
AprilSkies Ma che scherzi!
Beh forse la GUi, in effetti,... 9 Feb 2015, 19:47![]() ![]() |
| Versione Lo-Fi | Oggi è il: 16th November 2026 - 05:46 |