小编Pan*_*a97的帖子

显示当前时间Game Maker

我一直在努力简单地显示当前时间,无法在任何地方找到解决方案......对于错位的帖子感到抱歉.

我想要的只是在用户的电脑或手机上显示时间.

我能做的就是让时间显示在一个盒子里,而不是让它每秒都显示和更新.

这是我目前的代码

//store the current time
t=date_current_datetime();

//get the hour portion of that time
h=date_get_hour(t);

//get the minute portion of the time.
m=date_get_minute(t);

//get the second potion of the time
s=date_get_second(t);

//show the time
txt="The current time is:"+string(h)+":"+string(m)+":"+string(s);
show_message(txt); 
Run Code Online (Sandbox Code Playgroud)

希望这个游戏制作者代码有意义,感谢任何帮助.

datetime game-maker

3
推荐指数
1
解决办法
1458
查看次数

创建与对象关联的div

我之前问了一个类似的问题,但我找不到任何可以帮助我的东西.我现在已经更新了我的代码,但我现在完全卡住了.

这是我的PHP代码:

class person {
    public $name;
    public $SE;
    private $SD;

    function __construct ( $n, $s1, $s2 ) {
        $this->name = $n;
        $this->SE = $s1;
        $this->SD = $s2;
    }
}

$Obj = new person ( "ExampleName", 5, 5 );
Run Code Online (Sandbox Code Playgroud)

我需要为每个人创建单独的div,在这些div中包含他们的名字.我的主要问题是,在创建这些div之后,我需要以特定的方式对它们进行排序(这对你来说并不重要),这需要每个div都有一个ID与创建div的原始人相关联.

我能够从名单列表中创建div,但不能从对象创建div.所以:

  1. 我需要一种方法来使用foreach循环来根据每个对象(人)创建div.

  2. 我需要与这个人相关联的(与之相关的)div.

谢谢你的帮助

html php class object

0
推荐指数
1
解决办法
128
查看次数

标签 统计

class ×1

datetime ×1

game-maker ×1

html ×1

object ×1

php ×1