Bitte unterstützt uns und bestellt über diese Links bei Amazon oder HumbleBumble!
ShowHotspots3.1.asc
@@ -19,6 +19,16 @@ int g=70, b=70;
int islot=-1; // default icon: drawn circle
int ox, oy;
+// Fade effect
+// Initial start values
+int _fade_alpha = 0;
+int _fade_step = 1; // Transparency direction (1 = fade-out, -1 = fade-out)
+int _fade_timer = 0;
+
+// Fade settings
+int _max_transparency = 30; // 100 = fully transparent, 0 = not transparent
+int _fade_delay = 1; // Slow down effect by a delay: 1 = default speed, 2 = every second frame, 3 = every third frame, etc.
+
static function ShowHotspots::SetKey(eKeyCode keycode) {
_showhotspots_key = keycode;
}
@@ -204,11 +214,17 @@ function _Prepare() {
normalfont = Game.NormalFont;
Game.NormalFont = _showhotspots_font;
+ // Reset start values for transparency and timer
+ _fade_alpha = 0;
+ _fade_step = 1;
+ _fade_timer = 0;
+
// Create screen sized transparent sprite
hotspotSprite = DynamicSprite.Create(Screen.Width, Screen.Height, true);
// Create overlay
hotspotOverlay = Overlay.CreateGraphical(0, 0, hotspotSprite.Graphic, true);
+ hotspotOverlay.Transparency = _fade_alpha;
// Search and update hotspot condition
_SearchHotspots();
@@ -241,6 +257,28 @@ function repeatedly_execute_always() {
_Prepare();
}
+ // Start fade-in and fade-out
+ _fade_timer++;
+ if (_fade_timer >= _fade_delay) {
+ _fade_timer = 0;
+
+ _fade_alpha += _fade_step;
+
+ if (_fade_alpha >= _max_transparency) {
+ _fade_alpha = _max_transparency;
+ _fade_step = -1; // Switch to fade-in
+ }
+ else if (_fade_alpha <= 0) {
+ _fade_alpha = 0;
+ _fade_step = 1; // Switch to fade-out
+ }
+
+ if (hotspotOverlay != null && hotspotOverlay.Valid) {
+ hotspotOverlay.Transparency = _fade_alpha;
+ }
+ }
+ // ---------------------------------------------------
+
// Redraw Overlay for each frame
drs = hotspotSprite.GetDrawingSurface();
drs.Clear(COLOR_TRANSPARENT);
Zitat von: 1mal_volltanken in 16. August 2026, 00:25:58Edit: Hab mir das Maniacweed-Bernard-Starterpak runtergeladen. Das Scrolling sieht jetzt richtig flüssig aus.
Zitat von: AmigaMaster in 15. August 2026, 22:12:15Weiß jemand, warum man die ganzen Wait() vor unzähligen Aktionen gemacht hat, auch bei den Dialogen? Die Verzögern doch nur minimal (125ms) die nächste Aktion und eigentlich braucht man sie die meiste Zeit doch nicht, außer man will bewusst eine Verzögerung haben. Oder hat das andere Hintergründe, weil dann etwas anderes nicht funktioniert hat?
Zum Beispiel hier ein Auszug aus Bernards Raum:function hCertificate_AnyClick()
{
if (Verbs.AnyClickMove(175, 120, eDirectionUp))
{
if (Verbs.UsedAction(eGA_WalkTo))
{
// Wait(5);
}
else if (Verbs.UsedAction(eGA_LookAt))
{
Wait(5);
player.Say("'Gewinner des Eierkopfpreises.'");
}
else if (Verbs.UsedAction(eGA_PickUp))
{
Wait(5);
player.Say("Ich lass es, wo es ist.");
}
else if (Verbs.UsedAction(eGA_Use))
{
Wait(5);
player.Say("Ich will es nicht beschädigen.");
}
else if (Verbs.UsedAction(eGA_Open))
{
Wait(5);
player.Say("Ich kann es nicht öffnen.");
}
else if (Verbs.UsedAction(eGA_Close))
{
Wait(5);
player.Say("Ich kann es nicht schließen.");
}
else if (Verbs.UsedAction(eGA_Pull))
{
Wait(5);
player.Say("Ich lass es, wo es ist.");
}


function hCertificate_AnyClick()
{
if (Verbs.AnyClickMove(175, 120, eDirectionUp))
{
if (Verbs.UsedAction(eGA_WalkTo))
{
// Wait(5);
}
else if (Verbs.UsedAction(eGA_LookAt))
{
Wait(5);
player.Say("'Gewinner des Eierkopfpreises.'");
}
else if (Verbs.UsedAction(eGA_PickUp))
{
Wait(5);
player.Say("Ich lass es, wo es ist.");
}
else if (Verbs.UsedAction(eGA_Use))
{
Wait(5);
player.Say("Ich will es nicht beschädigen.");
}
else if (Verbs.UsedAction(eGA_Open))
{
Wait(5);
player.Say("Ich kann es nicht öffnen.");
}
else if (Verbs.UsedAction(eGA_Close))
{
Wait(5);
player.Say("Ich kann es nicht schließen.");
}
else if (Verbs.UsedAction(eGA_Pull))
{
Wait(5);
player.Say("Ich lass es, wo es ist.");
}