拖放后更新Image的位置(Update position of Image after drag and drop)
我在我的一些图像上实现了拖放功能。 除了图像的新位置没有保存并且每次重新启动应用程序时它们最终都在左下角,它的效果很好。 这就是我做的:
public GameScreen() { stageImage = new Stage(); @Override public void render(float delta) { game.batch.setProjectionMatrix(camera.combined); camera.update(); game.batch.begin(); flowerImage.setSize(300, 300); stageMove.act(Gdx.graphics.getDeltaTime()); stageMove.draw(); } @Override public void show() { flowerImage.addListener(new DragListener() { public void drag(InputEvent event, float x, float y, int pointer) { flowerImage.moveBy(x - flowerImage.getWidth() / 2, y - flowerImage.getHeight() / 2); flowerImage.setPosition(x,y); } }); stageMove.addActor(flowerImage); btnArrow.addListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { stageMove.clear(); game.setScreen(0);
退出屏幕时我必须.clear()阶段,否则当我重新进入时,舞台将创建图像的副本。 那么有人有解决方案吗? 我尝试过只是扮演舞台并从它的源头绘制图像,但这具有相同的效果。
I´ve implemented a drag and drop function on some of my images. And it works great besides that the new position of the images isn´t saved and they end up in the bottom left corner each time I restart the app. This is how I´ve done:
public GameScreen() { stageImage = new Stage(); @Override public void render(float delta) { game.batch.setProjectionMatrix(camera.combined); camera.update(); game.batch.begin(); flowerImage.setSize(300, 300); stageMove.act(Gdx.graphics.getDeltaTime()); stageMove.draw(); } @Override public void show() { flowerImage.addListener(new DragListener() { public void drag(InputEvent event, float x, float y, int pointer) { flowerImage.moveBy(x - flowerImage.getWidth() / 2, y - flowerImage.getHeight() / 2); flowerImage.setPosition(x,y); } }); stageMove.addActor(flowerImage); btnArrow.addListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { stageMove.clear(); game.setScreen(0);
I have to .clear() the stage when exiting the screen, otherwise the stage will create a duplicate of the image when I re-enter. So does anyone have a solution to this? I tried just acting the stage and drawing the image from it´s source, but that has the same effect.
原文:https://stackoverflow.com/questions/30030132
最满意答案
使用网络地图为您的操作系统(在Windows中,右键单击资源管理器和
Map Network Drive
的共享文件夹)。 然后,您可以使用映射驱动器从SQL Developer运行该脚本,例如:@z:\Shares\test\execute_report.sql
您可以对spool和output文件使用相同的文件寻址
Use network map for your operating system (in Windows, right click the shared folder in explorer and
Map Network Drive
). Then you can run the script from SQL Developer using the mapped drive, for example:@z:\Shares\test\execute_report.sql
You can use the same addressing of file for spool and output file
相关问答
更多-
使用简单的参数类型(即不是refcursors等),您可以执行以下操作: SET serveroutput on; DECLARE InParam1 number; InParam2 number; OutParam1 varchar2(100); OutParam2 varchar2(100); OutParam3 varchar2(100); OutParam4 number; BEGIN /* Assign values to IN parame ...
-
如何在SQL Developer中执行SQL Server存储过程?(How to Execute SQL Server Stored Procedure in SQL Developer?)[2022-05-01]
你不需要EXEC子句。 只需使用 proc_name paramValue1, paramValue2 (你需要逗号作为Misnomer提到) You don't need EXEC clause. Simply use proc_name paramValue1, paramValue2 (and you need commas as Misnomer mentioned) -
我能想到的一些事情: 确保命令中的路径是完全限定的(C:... etc)并用双引号括起来以避免路径名中的空格出现问题。 将路径粘贴到命令窗口中,并确保Robocopy打开正常。 确保运行SQL Server实例的帐户(可能是网络服务)可以访问robocopy可执行文件。 A few things I can think of: Make sure that the path in the command is fully qualified (C:... etc) and wrap it in double ...
-
从sql developer中的网络驱动器打开并运行sql文件(open and run the sql file from network drive in sql developer)[2021-05-26]
使用网络地图为您的操作系统(在Windows中,右键单击资源管理器和Map Network Drive的共享文件夹)。 然后,您可以使用映射驱动器从SQL Developer运行该脚本,例如: @z:\Shares\test\execute_report.sql 您可以对spool和output文件使用相同的文件寻址 Use network map for your operating system (in Windows, right click the shared folder in explorer ... -
我也尝试通过在FTP上传文件并尝试访问它来尝试相同的事情。 但是过去两周我没有取得任何进展。 我找到了其他替代方案,比如在另一台服务器上处理文件,并分享没有用户名和密码的文件夹。 然后我们可以通过给出\\ folder \ filename来访问它 如果你得到任何其他替代PLZ份额... Using the OPENROWSET means that SQL qill access files using the service account. This account must be used to a ...
-
如何在不使用XP_CMDSHELL的情况下在SQL查询中映射网络驱动器(How to map network drive in SQL query without using XP_CMDSHELL)[2021-08-05]
您可以创建两个作业,每个步骤只需一步(使用类型: Operating system (CmdExec) ,它将在cmd启动命令)。 在第一个工作net use创建驱动器 第二 - delete它 然后运行它们。 但请注意,在这种情况下,作业将启动,您需要等待几秒钟才能在wait delay的帮助下进行驱动。 例: 创建工作NetUse 。 在步骤中使用以下类型创建1个步骤: Operating system (CmdExec)在命令部分中net use写入net use : net use z: \\HOS ... -
您是否安装了Java 8 Development Kit(JDK)。 Oracle需要Java After some troubleshooting it ended up being an issue with having multiple versions of JRE & JDK installed (both 1.8.121 and 1.8.131 for JDK & JRE). I deleted the older 1.8.121 fodlers and re ran sqldeveloper ...
-
在PL'SQL Developer中有多个具有相同会话的SQL Windows(More then one SQL Windows with the same session in PL'SQL Developer)[2023-03-04]
在菜单工具/首选项“Oracle连接”中选择“会话模式” Single session或Dual session 。 并重新启动plsql开发人员。 In the menu Tools/Preferences "Oracle Connection" chose "Session Mode" Single session or Dual session. And restart plsql developer. -
尝试首先找到脚本所在的文件夹,然后连接到服务器并运行SQL> file.sql。 使用MySQL这是有效的。 Try go the folder where's the script first, then connect to the server and run SQL>file.sql. With MySQL this works.
-
您可以使用SQL BACKUP DATABASE Foo TO DISK = '\\myserver\myshare\foo.bak' WITH INIT 确保用于sql服务的帐户有足够的权限写入其他pc。 因为映射的网络驱动器不会显示在您的用户帐户中。 这与在另一个用户帐户下运行的Sql Server 服务有关,然后是您用于映射驱动器的用户帐户。 You can by using SQL BACKUP DATABASE Foo TO DISK = '\\myserver\myshare\foo.bak' ...